#Sales Offer!| Get upto 25% Off:

A student has established a monthly budget in this filePreview the document, where:

  • The first column represents the name of the expense
  • The second one the amount of money set aside for it.

The program should have one constant integer:

  • EXPENSE_COUNT = 10

The program should have a structure Expensewith the following members:

  • A string Namethat holds the name of the expense.
  • A float Budgetthat holds the amount of money set aside for it.
  • A float Spentthat holds the amount of money spent that month in that category.

Write a program that contains the following functions:

  • ReadData: Takes a reference to an fstreamcalled InputFileand an array of Expensecalled Spending.
    • Reads the contents of InputFileinto the corresponding elements of Spending, so that the first element of every line goes into Nameand the second one into Budget.
  • UserUpdate: Takes an array of Expensecalled Spending.
    • It displays each of the elements of Spending by name and asks the user how much they spent in said category. It stores this amount in said element under Spent.
  • Display: Takes a reference to an fstreamcalled OutputFileand an array of Expensecalled Spending.
    • Prints into a file the following:
      • A header line with “Name”, “Goal”, “Spent” and “Difference”.
      • For each element of Expenses, a line with the value of Name, Budgetand Spent, followed by the difference between Spentand Budget.

Write a program that contains an array of elements of the Expensestructure and follows these guidelines to take the file provided to you and asks the user to enter the amount they have spent, then produces another file with the original information plus that introduced by the user and the difference between the amount spent and the original goal.

Found something interesting ?

• On-time delivery guarantee
• PhD-level professional writers
• Free Plagiarism Report

• 100% money-back guarantee
• Absolute Privacy & Confidentiality
• High Quality custom-written papers

Related Model Questions

Feel free to peruse our college and university model questions. If any our our assignment tasks interests you, click to place your order. Every paper is written by our professional essay writers from scratch to avoid plagiarism. We guarantee highest quality of work besides delivering your paper on time.

Grab your Discount!

25% Coupon Code: SAVE25
get 25% !!