Question
Housing: $500.00 Utilities: $150.00 Household Expenses:$65.00 Transportation:$50.00 Food:$250.00 Medical:$30.00 Insurance:$100.00 Entertainment:$150.00 Clothing:$75.00 Miscellaneous: $50.00 -Write a program in C++ that has a Monthly Budget structure
Housing: $500.00
Utilities: $150.00
Household Expenses:$65.00
Transportation:$50.00
Food:$250.00
Medical:$30.00
Insurance:$100.00
Entertainment:$150.00
Clothing:$75.00
Miscellaneous: $50.00
-Write a program in C++ that has a Monthly Budget structure designed to hold each of these expense categories.
-The program should pass the empty structure to a function that asks the user to enter the amounts spent in each budget category during a month and return a structure as a result.
- Write a separate function to add a Monthly Budget Structure to a file. The writing task should add the new Monthly Budget in one single line at the end of the file and preserve the old content.
-Write a separate function to count the number of lines in the file and return it as result.
- Write a separate function to show the saved Monthly Budgets from the file. The function reads data from the file, saves it into a dynamically allocated array of Monthly Budgets and displays the Monthly Budget list from the array.
- Your program must display a menu with three options, 1) Add a Monthly Budget, 2) Show List, 3) Exit. The program must loop until the user selects option 3 and you must ensure the user has entered a valid option.
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