Write a program that contains an array of elements of the Expensestructure and follows these guidelines to take the file provided to you

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.

find the cost of your paper

The post Write a program that contains an array of elements of the Expensestructure and follows these guidelines to take the file provided to you appeared first on Best Custom Essay Writing Services | EssayBureau.com.

GET HELP WITH YOUR HOMEWORK PAPERS @ 25% OFF

For faster services, inquiry about  new assignments submission or  follow ups on your assignments please text us/call us on +1 (251) 265-5102

Write My Paper Button

WeCreativez WhatsApp Support
We are here to answer your questions. Ask us anything!
👋 Hi, how can I help?
Scroll to Top