sample run

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter16: Searching, Sorting And Vector Type
Section: Chapter Questions
Problem 20PE
icon
Related questions
Question

Please mention what sample run

11.11: Customer Accounts
Lab
A student has established the following monthly budget:
500.00 Housing
150.00 Utilities
65.00 Household
50.00 Expenses
50.00 Transportation
250.00 Food
30.00 Medical
100.00 Insurance
150.00 Entertainment
75.00 Clothing
50.00 Miscellaneous
Write a program that has a MonthlyBudget structure designed to hold each of these expense categories. The program should pass the structure to a function that
asks the user to enter the amounts spent in each budget category during a month. The program should then pass the structure to a function that displays a
report indicating the amount over or under in each category, as well as the amount over or under for the entire monthly budget.
NOTES: For each of the categories listed above, and in that order, the program prompts the user for the
the amount spent on X: where X is a category from the above list (e.g. "Insurance").
Using the values read into the structure, the program generates a table with a heading and in each row
there are four items: the category (e.g. "Housing"), followed by the value budgeted for the category (500.00 in the case of Housing), followed by the value that
had been read in for that category, followed by the amount that the actual spent was over or under the category budget.
Finally, after the table, is an indication of whether the student is over or under budget.
Input Validation. None.
Transcribed Image Text:11.11: Customer Accounts Lab A student has established the following monthly budget: 500.00 Housing 150.00 Utilities 65.00 Household 50.00 Expenses 50.00 Transportation 250.00 Food 30.00 Medical 100.00 Insurance 150.00 Entertainment 75.00 Clothing 50.00 Miscellaneous Write a program that has a MonthlyBudget structure designed to hold each of these expense categories. The program should pass the structure to a function that asks the user to enter the amounts spent in each budget category during a month. The program should then pass the structure to a function that displays a report indicating the amount over or under in each category, as well as the amount over or under for the entire monthly budget. NOTES: For each of the categories listed above, and in that order, the program prompts the user for the the amount spent on X: where X is a category from the above list (e.g. "Insurance"). Using the values read into the structure, the program generates a table with a heading and in each row there are four items: the category (e.g. "Housing"), followed by the value budgeted for the category (500.00 in the case of Housing), followed by the value that had been read in for that category, followed by the amount that the actual spent was over or under the category budget. Finally, after the table, is an indication of whether the student is over or under budget. Input Validation. None.
SAMPLE RUN #1: . /ETest
Interactive Session
Hide Invisibles
Highlight: None
Show Highlighted Only
Enter•the•amount•spent•on•housing:•500-
Enter·the•amount•spent•on•utilities:•150-
Enter•the•amount•spent•on•household•expenses:•65e
Enter•the•amount•spent•on•transportation::50e
Enter·the•amount•spent•on•food::250+
Enter·the•amount•spent•on•medical·expenses:•30-
Enter·the•amount•spent•on•insurance:•100+
Enter·the•amount•spent•on•entertainment::150+
Enter•the•amount•spent•on•clothing:•75-
Enter·the•amount•spent•on•miscellaneous•expenses: •49.99-
Category
•Budgeted•………•Spent•••Over(-)/Under-
---
500.00• ..•500.00•
Housing.
Utilities•
• • 0.00+
• •0.00
•• •0.00+
•150.00••••150.00•
Household
• 65.00• ••.•65.00•
Transportation
•50.00•••••50.00•
0.00-
• 250.00••.•250.00•
• 30.00••..•30.00•
Food•.
•0.00+
Medical·•
••0.00+
Insurance:
100.00••••100.00•
• • • 0.00+
Entertainment
150.00••••150.00•
0.00-
Clothing•••.
• 75.00• ••.•75.00• •.
••50.00• ••.•49.99•
0.00-
Miscellanous
•0.01-
For•the•month•you•are•under•budget•by•$0.01-
Transcribed Image Text:SAMPLE RUN #1: . /ETest Interactive Session Hide Invisibles Highlight: None Show Highlighted Only Enter•the•amount•spent•on•housing:•500- Enter·the•amount•spent•on•utilities:•150- Enter•the•amount•spent•on•household•expenses:•65e Enter•the•amount•spent•on•transportation::50e Enter·the•amount•spent•on•food::250+ Enter·the•amount•spent•on•medical·expenses:•30- Enter·the•amount•spent•on•insurance:•100+ Enter·the•amount•spent•on•entertainment::150+ Enter•the•amount•spent•on•clothing:•75- Enter·the•amount•spent•on•miscellaneous•expenses: •49.99- Category •Budgeted•………•Spent•••Over(-)/Under- --- 500.00• ..•500.00• Housing. Utilities• • • 0.00+ • •0.00 •• •0.00+ •150.00••••150.00• Household • 65.00• ••.•65.00• Transportation •50.00•••••50.00• 0.00- • 250.00••.•250.00• • 30.00••..•30.00• Food•. •0.00+ Medical·• ••0.00+ Insurance: 100.00••••100.00• • • • 0.00+ Entertainment 150.00••••150.00• 0.00- Clothing•••. • 75.00• ••.•75.00• •. ••50.00• ••.•49.99• 0.00- Miscellanous •0.01- For•the•month•you•are•under•budget•by•$0.01-
Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Web Page
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning