Question: Demo Problem: Write a program that stores the following data about expense categories for a student s budget: category name, the amount allocated to it

Demo Problem: Write a program that stores the following data about expense categories for a students budget: category name, the amount allocated to it, and the amount spent. The program should:
1. Initialize the name and allocated amount for each category.
2. Ask the user to enter the amount spent for each category.
3. Show a table listing each categorys name, amount allocated, amount spent, and over-under amount.
4. Display the total amount over or under budget.
Problem specifications: Assume that these are the names of the categories and the allocated amounts:
Housing $500.00
Transportation $50.00
Food $250.00
Entertainment $150.00
Clothing $75.00
Other $50.00
Sample output:
How much was spent on Housing ?398
How much was spent on Transportation ?55.76
How much was spent on Food ?260
How much was spent on Entertainment ?150
How much was spent on Clothing ?75.75
How much was spent on Other ?39
Categories: Budget: Spent: Over-Under
Housing 500.00398.00102.00
Transportation 50.0055.76-5.76
Food 250.00260.00-10.00
Entertainment 150.00150.000.00
Clothing 75.0075.75-0.75
Other 50.0039.0011.00
The total money spent is $96.49 under the budget.
(if the total spent is > the total budget, this line should report the amount over the 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 Programming Questions!