0

How to draw a flowchart for this:
-Input the number of values (n) to be averaged. Check the number of values to ensure that it is in the range of 1 to 25. If the value is out of range, display an error message and use a loop to input a new value until the value of n is correct.
-Input a grade. Check that the grade is within the range of 0 to 100. If the grade is out of range, display an error message and use a loop to input a new grade until it is within the desired range.
- Loop back and input more grades until n grades have been input.
- Calculate the average of the grades that were entered by the user.

so far i have this.

Edited by JudeV: i forgot to put my answer

Attachments
2
Contributors
1
Reply
3
Views
6 Years
Discussion Span
Last Post by Taywin
1

You are close. You still need to verify the 'n' value first. And then you need to validate the grade with more than just less than 0. The requirement states that it must be between 0 and 100. Then, you need to keep track of how many number the user has entered. Sum it up while you are counting. Then compute the average before display the result.

before start:
total = 0
sum = 0

                               START
                                 |
            +------------------->|
            |                    v
            |         +----------------------+
            |         | Enter Max Number (n) |
            |         +----------------------+
            |                    |
            |                    v
            |                   / \
            |                 /     \
       +---------+          /  n>=1   \
       | display |<__no__ /     &&      \
       |  error  |        \    n<=25    /
       +---------+          \         /
                              \     /
                                \ /
   +---------------------------->|
   |        +------------------->| yes
   |        |                    v
   |        |          +-------------------+
   |        |          | Enter a Grade (g) |
   |        |          +-------------------+
   |        |                    |
   |        |                    v
   |        |                   / \
   |        |                 /     \
   |   +---------+          /  g>=0   \
   |   | display |<__no__ /     &&      \
   |   |  error  |        \    g<=100   /
   |   +---------+          \         /
   |                          \     /
   |                            \ /
   |                             |
   |                             | yes
   |                             v
   |                       +------------+
   |                       | total += 1 |
   |                       |   sum += g |
   |                       +------------+
   |                             |
   |                             v
   |                            / \
   |                          /     \
   |                        /         \
   |_________________no__ /  total==n   \
                          \             /
                            \         /
                              \     /
                                \ /
                                 |
                                 | yes
                                 v
                            +---------+
                            | Compute |
                            | Average |
                            +---------+
                                 |
                                 v
                            +---------+
                            | Display |
                            | Average |
                            +---------+
                                 |
                                 v
                                DONE

Edited by Taywin: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.