Gallery
Debug 5.3. Baggage Check
Share
Explore
Debug 5.3. Baggage Check

icon picker
The Task

Activity: Debug 5.3 Baggage Check 🐞

Start Here

A bug report has been has been submitted on this program. This program should ask the user to enter the weight of 2 bags at an airport. It should check if the total weight is on or below the limit of 40 kg. The program isn’t working. The senior developer says the code around the if else statement is messed up. 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.
Good luck! 🍀

Sample Output

Please enter the weight of first bag (kg): 21


Please enter the weight of second bag (kg): 12



That is OK 33 is under 40 Kgs. Thanks!
Please enter the weight of first bag (kg): 22


Please enter the weight of second bag (kg): 21



Sorry 43 is over 40 Kgs. You can pay extra though.
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.