QUESTION IMAGE
Question
below is a flowchart for calculating the average of three grades. identify three errors in the flowchart. start declarations num grade1 num grade2 string grade3 string average input grade1 input grade2 average = grade1 + grade2 + grade3 / 3 output average
Step1: Incorrect data - type declaration for grade3
grade3 is declared as a string, but it should be a numeric type (like num) to calculate an average with grade1 and grade2.
Step2: Incorrect data - type declaration for average
average is declared as a string, but it should be a numeric type since it will hold the result of a numerical calculation (sum of grades divided by 3).
Step3: Incorrect average calculation formula
The formula for calculating the average should be (grade1 + grade2+ grade3)/3, not grade1 + grade2 + grade3/3. The latter follows the wrong order of operations and will not give the correct average.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
- Incorrect data - type declaration for grade3 (should be num not string).
- Incorrect data - type declaration for average (should be num not string).
- Incorrect average calculation formula (should be (grade1 + grade2 + grade3)/3).