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
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.
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.
Write a Java Program to bubble sort 10,20,15,0,6,7,2,1,-5,55. Including Algorithm flowchart of the program.
Write a Java Program to bubble sort 10,20,15,0,6,7,2,1,-5,55. Including Algorithm flowchart of the program.
Write out an algorithm (using a list of steps or a flowchart), for describing to someone...
Write out an algorithm (using a list of steps or a flowchart), for describing to someone how to take the derivative of a polynomial of order n. ?(?) = ?0 + ?1? 1 + ?2? 2 + ⋯ + ??? ?
Write a script to display numbers from 1 to n, where n is an integer provided...
Write a script to display numbers from 1 to n, where n is an integer provided by users (if not, default to 10). Hint: use “read” command to accept user input. a) Display the source code in an editor (#4-9) b) Execute your script in the terminal, and display the command and the result (#4-10)
Create a flowchart to explain the risk assessment process.
Create a flowchart to explain the risk assessment process.