Purchase Solution

Budgeting Report for a Local Company Using C++

Not what you're looking for?

Ask Custom Question

You are to develop a budgeting report for a local company using a C++ program. There are two input files. The first input file lists the individual areas a budget has been defined for. Two of these are the two checking accounts where the budget is the amount of money in the accounts. The 'ledger.dat' file contains the list of budget areas.

A second file contains the list of invoices and written checks against a given budget.
You are to read in the second file 'journal.dat' and update the value in each of the budgeted areas.
Print out a report showing the budgets and their current values. Some will be under and other will be over budget.

Use an array of structures to hold the data. Use pointers to move through the array (no subscripts syntax). Read in the 'ledger.dat' and initialize the array of structs. Read in the 'journal.dat' and update the values in the array of structs.

Format of 'ledger.dat' file.
budget# budget name initialValue

Format of 'journal.dat' (More data on a line of input than you need.)
Budget# Number? date ExpenseAreaText ExpenseValue
ExpenseValue is a positive for cost and negative for deduction

Print out a nice table (using pointers) of the budget areas and the resulting balance.

Purchase this Solution

Solution Summary

Attached program code has been tested compiling warning and error free, and working, using GNU C++ compiler "g++" version 4.3.4 . Please study this response thoroughly and formulate your own response in your style of writing code and comments, removing extra things that you do not need there - like this response prints the formatted ledger data as read from "ledger.dat" file as a cross-checking measure, and there are couple of error checks that you might not need.

Solution Preview

Please find attached an implementation "503784.cpp" and corrected "journal.dat" file.

Please note that there are two issues with your "journal.dat" file.

1. The entry "565 1287 04/20/98 Electric^I^I 145.63" has two tab characters, as indicated by '^I' here. Rest of the entries in journal.dat and ledger.dat do not have tab characters at all.
The response works with the assumption that only space would be used in the ledger and journal entries.

2. Your "journal.dat" specifies negative expense values like "- 78.70", "- 500.00", ... . Since ExpenseValue is a single column, how can you have the negative sign separated from the values, sometimes by single space, sometimes by two spaces? It should be uniform representation of values in this column, like "-78.70", "-500.00", ... with no space character coming between the sign and the value. Presence of space there means we should have two columns there - one for sign and one for absolute value, however we have just single column for ExpenseValue.

This response ...

Purchase this Solution


Free BrainMass Quizzes
Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

C++ Operators

This quiz tests a student's knowledge about C++ operators.