Question: in Java programming Task 4: (20 marks) Write a program that prompts the user to firstly input the amount a person has budgeted for a

 in Java programming Task 4: (20 marks) Write a program that

in Java programming

Task 4: (20 marks) Write a program that prompts the user to firstly input the amount a person has budgeted for a month. A loop should then prompt the user to input each of the expenses (zero indicates the user is done with entering an expense) for the month and keep a running total (the total amount of expenses). When the loop finishes, your program should calculate the difference between budgeted amount and the total expenses. If the budgeted amount is larger than total expenses, display "you are $xx under budget". If the total expenses is larger than budgeted amount display "you are $xx over budget". If the total expenses is equal to budgeted amount display "good planning". Your result should be like, for example, below: Enter amount budgeted for the month: 1000 Enter an amount spent(0 to quit): 200 Enter an amount spent(0 to quit): 50 Enter an amount spent(0 to quit): 150 Enter an amount spent(0 to quit): 0 You are $600 under budget

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!