Question
a) Budget Analysis - while loop Write a program that asks a user to enter the amount of money they have budgeted for the month.
a) Budget Analysis - while loop
Write a program that asks a user to enter the amount of money they have budgeted for the
month. Then ask the user for the amount of their first expense and subtract it from the
monthly budget amount. Continue to ask the user for an expense amount and update the
budget amount until the user enters a value of zero for the expense amount. Once the user
has entered a zero, display the amount of money remaining in the monthly budget. If the
amount remaining is negative, display a message that the user is over budget.
Hint: Use a sentinel loop
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started