Question: Please help i'm lost on this project: Budget Analysis Write a program so that the monthly budget and the indefinite list of expenses is input
Please help i'm lost on this project:
Budget Analysis
Write a program so that the monthly budget and the indefinite list of expenses is input from a data file. The following is a reasonable design for the data text file named expenses.txt, but you are welcome to organize it another way. No spaces are needed between each line, it just pasted that way.
January 2017
1616
Car payment
309
Rent
652
Insurance
200
Supermarkets_food
500
Restaurants
150
Internet_service
56
Cell_phone
109
Gasoline
175
Program Specifications:
Data is input from a file.
The list of expenses data is stored in parallel arrays (or vectors).
The expenses data includes the descriptive label (e.g., Car payment) and the expense amount (e.g., 309).
The months budget amount is displayed.
The input expenses data is output in a tabular format showing the list of expense labels and amounts.
The sum of the expenses is computed and output.
An appropriate comment is displayed comparing the month's expenses to the budgeted.
The largest and smallest budgeted expense are displayed.
Should input this:

I have this but it shows up $0 for me
#include
#define MAX 1000
using namespace std;
int main()
{ ifstream infile; char name[MAX],item[MAX][MAX]; float dollar,budget,sum = 0; int count = 0; float price[MAX];
infile.open("expenses.txt"); if (!infile.is_open()) { cerr
while(infile.getline(name,MAX)) { strcpy(item[count],name); infile.getline(name,MAX); price[count] = atof(name); sum += atof(name);
coutbudget) cout
int i,max_i = 0,min_i = 0; for(i=1;i
for(i=1;i cout return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
