Answer to Question #313631 in Algorithms for Adunnamani Sunday

Question #313631

1, Develop an algorithm to calculate the sum of 5 numbers.

2, Develop an algorithm to find the largest number among the 3 numbers.

3, Develop an algorithm to calculate the average score of 50 student.


1
Expert's answer
2022-03-18T03:19:15-0400
1, Develop an algorithm to calculate the sum of 5 numbers.


Start
   Declare Real number1,number2,number3,number4,number5, sum=0
   Display "Enter number1,number2,number3,number4,number5: "
   Input number1,number2,number3,number4,number5
   Set sum=number1+number2+number3+number4+number5
   Display "Sum: "+sum
Stop
2, Develop an algorithm to find the largest number among the 3 numbers.
Start
   Declare Integer n
   Declare Integer i
   Declare Integer largest=-111111
   For i = 1 To 3
      Display "Enter ", i, ": "
      Input n
      if n> largest
          largest=n
      end if
   End For
   Display "The largest number is: ", largest
Stop
3, Develop an algorithm to calculate the average score of 50 student.
Start
   Declare Integer score
   Declare Integer i
   Declare Integer sum
   Declare Real average
   Set sum=0
   For i = 1 To 50
      Display "Enter score", i, ": "
      Input score
      Set sum=sum+score
   End For
   average =sum/50
   Display "The average score of 50 student is: ", average
Stop

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS