How can I write the algorithm in pseudocode to solve this problem:

There is 15 pupils in the introduction to programming 1 module. The age of every student is entered in years and months. Convert the age into months to calculate the average. Display the answer(Average age) and months on screen.

I have manage to write my Planning and IPO Chart, now I'm stuck... in algorithim "Processing step" where I have to convert age into months and calculate the average.

please I need help.

2 answers

as usual, the average is the sum of all the ages, divided by the number of pupils. Count the pupils as they come in:

num_pupils = sum_of_ages = 0
loop {
read in years, months
num_pupils++
age_in_months = years*12 + months
sum_of_ages += age_in_months
}
average_age = sum_of_ages/num_pupils
Do the planning and write algorithm to solve for following problem.



There are 15 pupils in the Introduction to Programming I module. The age of every student is entered in years and months. Convert the age into months to calculate the average age. Display the ans
Similar Questions
  1. directiona. Your algorithm should be written both in pseudocode and flow chart. b. You have to show each and necessary steps
    1. answers icon 1 answer
  2. Problem-Solving1. Develop an algorithm or write pseudocode to determine if a citizen is eligible to vote. The criteria for
    1. answers icon 0 answers
  3. 3.Do the planning and write algorithm to solve for following problem.There are 15 pupils in the Introduction to Programming I
    1. answers icon 2 answers
  4. Do the planning and write algorithm to solve for following problem.There are 15 pupils in the Introduction to Programming I
    1. answers icon 0 answers
more similar questions