Post a New Question

Programming logic and design

posted by .

Design a program that lets the user enter the total rainfall for each 12 months into an array. The program should calculate and display the total rainfall for the year the average monthly rainfall, and the month with the highest and lowest amounts.

In pseudo-code and a flowchart

  • design, no particular language design -

    first column = n = month number from 1 to 12
    second column = rainfall for n R(n)
    third column = total rain so far
    Rmin = 5000 (unrealistic high)
    Rmax = 0
    Rav = 0
    Rtot = 0
    Do loop A for n = 1, 12
    Read R(n)
    If R(n) > Rmax, then Rmax = R(n)
    If R(n) < Rmin, then Rmin = R(n)
    Rtot = Rtot + R(n) (this is total so far)
    Rav = Rtot/n (this is the average so far)
    write n, R(n),Rtot, Rav, Rmax, Rmin
    A end of loop

  • Programming logic and design -

    1, 12

Answer This Question

First Name:
School Subject:

Related Questions

More Related Questions

Post a New Question