Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Requirements: 1 . Create multiple C + + files ( put them in the same directory / folder ) : a . Create a header

Requirements:
1. Create multiple C++ files (put them in the same directory/folder):
a. Create a header file called expense.h. This header file contains your
Expense class data definitions and method prototypes. (Hint: Look at
BankAccount.h). All data members must be declared as private and provide
getter/setter methods to access them.
b. Create a new CCP file called expense.cpp to implement methods defined
your header file.
c. Create a main program called main-expense.cpp that displays the menu and
utilize your Expense (Expense must implement these methods) class to:
i. Display description and amount
ii. Determine if a substring is part of the description and return true or false
2. The program must produce the same output as provided. The output should be
formatted nicely as given.
3. The program must use array of Expense class. Hint: you must define a default
constructor in Expense.h to allow array declarations.
4. The program must not use global variables. In another words, it must use local variables
and pass-by-value or pass-by-reference parameters.
5. The program must define the maximum number of entries such as 100 and keeps track
of the actual count of the current number of expenses entered by the user. You can also
utilize vector class to keep track of your expense objects.
6. You should use data file to save or read from. At the beginning of your program, it reads
data from a data file named expenses.txt and initialize your object array with this data.
Your program must check to see if the file exists or has data to read. Before your
program exits, it must save all expenses amount and descriptions into the data file.
7. You must write at least 2 functions in main-expense.cpp.
8. You need to submit all header files, CPP files and data file expenses.txt
Required error handling:
The program MUST perform the following checks:
1. Check for invalid amount (negative or 0 number)
2. Description cannot be empty.
3. Search is case-insensitive (ignore case, but the user may type in any case).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions