Question

Create an algorithm that will accept 4 numbers and display the sum and average.Draw a flowchart.

Create an algorithm that will accept 4 numbers and display the sum and average.Draw a flowchart.

Homework Answers

Answer #1

FLOWCHART:

ALGORITHM:

1) Start

2) Let sum=0, avg=0

3) Now read input numbers from user and add them to sum

for(i=1;i<=4;i++)

{

read num

sum=sum+num

}

4) Calculate average using sum

avg=sum/4

5) Print sum and avg

6) Stop

SUMMARY:

The above flowchart and algorithm shows the sum and average calculation of the 4 numbers read from the user. We first declare variable sum and avg and initialize them to 0. Then we iterate loop to 4, read number and calculate sum as well. After sum is calculated we find average of the sum/total_numbers (4 in this case).

Note: If you have any queries than let me know in the comments. If you find it helpful than a Like would be appreciated.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Make an algorithm in the form of a sentence and flowchart from the following cases: a)...
Make an algorithm in the form of a sentence and flowchart from the following cases: a) Create an algorithm to determine the largest value among three numbers. b) Algorithm for printing numbers 1 to 10 with instruction do.....while
draw flowchart of: 1-algorithm that asks the user to enter three numbers and computes and prints...
draw flowchart of: 1-algorithm that asks the user to enter three numbers and computes and prints out the largest number. 2- an algorithm that asks the for an integer N from the user. The algorithm should find whether the number is positive, negative, or ZERO. 3-an algorithm that asks the user to enter a positive integer N. You then need to calculate the sum of all values from 1 to N.
1- Write algorithm (in pseudo-code) for the following problem: sum of the series: 1 +2+3+…+N 2-...
1- Write algorithm (in pseudo-code) for the following problem: sum of the series: 1 +2+3+…+N 2- Convert an algorithm to a flowchart diagram. 3- Counting the primitive operations of the algorithm. 4- Determine algorithm complexity. 5- Write a complete C++ program for the previous algorithm where the program should contain the following:  Display messages.  Input any number;  Display the series.  Display the sum of the series.
Make an algorithm in the form of a sentence and flowchart from the following cases: The...
Make an algorithm in the form of a sentence and flowchart from the following cases: The trichotomy of real numbers states that, if X and Y are any real numbers, then there are 3 possible relationships that occur between X and Y, namely X = Y, X > Y or X < Y. Create an algorithm to deduce the relationship between X and Y.
Design the logic for a program that allows a user to enter 10 numbers, stores the...
Design the logic for a program that allows a user to enter 10 numbers, stores the numbers in an array, then displays all of the numbers, the largest number, and the smallest.  create a solution algorithm using pseudocode  create a flowchart Need to do flowchart in Raptor and can't get it to do min and max or display the array
Write an algorithm that adds up a sequence of twenty numbers and outputs the sum of...
Write an algorithm that adds up a sequence of twenty numbers and outputs the sum of the numbers as well as the average of the numbers. (Your algorithm MUST use the repetition control structure to read in and process the inputs.)
Create a flowchart that will increase the value of the number by 5 if it is...
Create a flowchart that will increase the value of the number by 5 if it is greater than 10 and display the result. Otherwise, multiply the value by 5 and display the result.
1.Draw a flowchart to read 3 numbers: M, K and N and print the largest number...
1.Draw a flowchart to read 3 numbers: M, K and N and print the largest number of them. 2. Devolve an algorithm that allows the user to enter the count of number in a list followed by these numbers. The algorithm should find and output the minimum and maximum numbers in the list. 3. Develop an algorithm that inputs a series of number and output their average.
Create a bash script that takes numbers as parameters, calculates sum and prints the result. If...
Create a bash script that takes numbers as parameters, calculates sum and prints the result. If no parameters passed, prompt a user (only one time) to enter numbers to sum and print the result.
Create a bash script that takes numbers as parameters, calculates sum and prints the result. If...
Create a bash script that takes numbers as parameters, calculates sum and prints the result. If no parameters passed, prompt a user (only one time) to enter numbers to sum and print the result.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT