Gallery
Debug 4.3. Total Points
Share
Explore
Debug 4.3. Total Points

icon picker
The Task

Activity: Debug 4.3 Total Points 🐞

Start Here

A bug report has been has been submitted on this program. The program should ask for five numbers for the event points in a pentathlon and print out a total. When the program is run it appears to ask for five points values but the wrong total is outputted each time even though the correct calculation is displayed at the end of the program. As you can see in the design below it is supposed to by calculating the total by using a running total. Can you help fix it?
Run and explore the program to identify errors.
Refer to the code clips below to help you fix the errors.
Right click on your code and add a comment explaining what was wrong and how you fixed it.

design

set total to 0
get event one from keyboard
add event one to total
get event two from keyboard
add event two to total
get event three from keyboard
add event three to total
get event four from keyboard
add event four to total
get event five from keyboard
add event five to total
display message with numberOne, numberTwo, numberThree, numberFour, numberFive and total

sample output

Enter the first number: 11
Enter the second number: 22
Enter the third number: 33
Enter the fourth number: 44
Enter the fifth number: 55

11 + 22 + 33 + 44 + 55 = 165
Good luck! 🍀
Share
 
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.