Question
In this homework, you will be making a different version of your Homework #3. You will be using a map to store Transaction objects (values)
In this homework, you will be making a different version of your Homework #3. You will be using a map to store Transaction objects (values) sorted by Date objects (keys). You will also be making a menu to allow a user to select different options and input data.
Part 1:
Classes You are to implement 3 classes: Date, Transaction, and Transaction List. Date represents a date, down to the second. It has 6 private variables: year representing the year, month representing the month, day representing day, hour representing the hour, minute representing the minute, and second representing second. There are also 4 public functions. The constructor takes in values for the private variables and assigns them. to_string() converts the data of the class to a string. operator
Part 2: main.cpp In the main cpp, you must create a menu where the user can select different options. These options must include printing out the list of transactions, adding a new transaction, deleting a current transaction by date, deleting all transaction by a certain employee, getting the average transaction, and getting the name of the person who earned the bonus. Please note that menus may have a submenu or require additional input, such as asking for the date, price, and name. Here is an example menu:
Welcome to the Transaction List Management Solution.
Please make a selection from the following menu:
1: Print all transactions
2: Add a transaction
3: Delete a transaction(s)
4: Average transaction value
5: Bonus winner ?
All functionally must be able to be tested by the GTA when grading.
Part 3: Bonus 1 (5pts) This will be the exact same as the full credit, but will require you to get the system time for the date when a new transaction is added instead of asking the user for a date.
Part 4: Bonus 2 (10pts) You will modify the Transaction class to only have the price private variable and to have the get_name() method removed. This will require the constructor and to_string() method to be changed as well. You will then create a new class called Employee that has private variables name and id. This class should have a constructor, accessor methods for these fields, as well as a to_string() and an operator Transaction List ransactions :map Date, Transaction> + Transaction List() +add transaction(date: Date, transaction : Transaction) : bool +list transactions() +get average transaction): double + bonus): string +to string): string +operator
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started