Question: Instructions Replit Folder: companydb - cpp This will be an object oriented C + + program with the following behavior: At the program's start, it

Instructions
Replit Folder: companydb-cpp
This will be an object oriented C++ program with the following behavior:
At the program's start, it will prompt for the name of a company.
The program will attempt to load the company's data from the file "name.dat". For example, if you enter "acme" it will try to load from "acme.dat". If the file does not exist, the program will create a blank one.
The program will then present a menu that lets the user do the following:
View/Add Employees
View/Add Sales and Customers
Exit
Upon program exit, it will save the contents of the company database to the file specified above.
Design
This is an object oriented program, and you are required to make use of the UML design pictured below. You can add additional functions if you like, but these are the classes you should create.
UML Class Diagram
For each class, you must create a header and implementation file.
File Format
The file format is line oriented, containging the following layout:
Number of Employees
Employee Records
Number of Customers
Customer Records
The employee records are themselves line oriented and follow this format:
Name
Email
Phone
Salary
The customer reocrds are line oriented and follow this format:
Name
Email
Phone
Number of Purchases
Purchases
Each purchase follows the following format:
Item
Quantity
Cost
Please see the sample files listed here for more information.
acme.dat
newco.dat
Sample Run
A sample run of the program is shown below.
~/cs609-program/cpp $ make clean
rm -f *.o companydb
~/cs609-program/cpp $ make
g++-c companydb.cpp -g --std=c++20
g++-c customer.cpp -g --std=c++20
g++-c employee.cpp -g --std=c++20
g++-c person.cpp -g --std=c++20
g++-c purchase.cpp -g --std=c++20
g++-g --std=c++20-c -o company.o company.cpp
g++-o companydb companydb.o customer.o employee.o person.o purchase.o company.o -g --std=c++20
~/cs609-program/cpp $ ./companydb
Company Name: acme
MAIN MENU
1.) Employees
2.) Sales
3.) Quit
Choice? 1
Wile E. Coyote Phone: 555-1234 Salary: $60000.00
Road Runner Phone: 555-1122 Salary: $90000.00
(A)dd Employee or (M)ain Menu? A
Name: Elmer Fudd
Email: efudd@acme.com
Phone: 555-5390
Salary: 65000.00
Wile E. Coyote Phone: 555-1234 Salary: $60000.00
Road Runner Phone: 555-1122 Salary: $90000.00
Elmer Fudd Phone: 555-5390 Salary: $65000.00
(A)dd Employee or (M)ain Menu? M
MAIN MENU
1.) Employees
2.) Sales
3.) Quit
Choice? 2
(A)dd Customr, Enter a (S)ale,(V)iew Customer, or (M)ain Menu? A
Name: Babs bunny
Email: bbunny@acmeu.edu
Phone: 555-2721
(A)dd Customr, Enter a (S)ale,(V)iew Customer, or (M)ain Menu? S
1.) Bugs Bunny
2.) Yakko Warner
3.) Babs bunny
Choice? 2
Item: Anvil
Quantity: 10
Cost: 12.95
(A)dd Customr, Enter a (S)ale,(V)iew Customer, or (M)ain Menu? S
1.) Bugs Bunny
2.) Yakko Warner
3.) Babs bunny
Choice? 2
Item: Dynamite
Quantity: 12
Cost: 19.95
(A)dd Customr, Enter a (S)ale,(V)iew Customer, or (M)ain Menu? V
1.) Bugs Bunny
2.) Yakko Warner
3.) Babs bunny
Choice? 2
Yakko Warner Phone: 555-3366
Order History
Item Price Quantity Total
Candygram With Explosives 15.00115.00
Candygram With Explosives 15.00115.00
Anvil 12.0010120.00
Dynamite 19.0012228.00
(A)dd Customr, Enter a (S)ale,(V)iew Customer, or (M)ain Menu? M
MAIN MENU
1.) Employees
2.) Sales
3.) Quit
Choice? 3
~/cs609-program/cpp $ ./companydb
Company Name: newco
MAIN MENU
1.) Employees
2.) Sales
3.) Quit
Choice? 1
(A)dd Employee or (M)ain Menu? A
Name: Duke Nukem
Email: dnukeum@newco.com
Phone: 111-2222
Salary: 1000000
Duke Nukem Phone: 111-2222 Salary: $1000000.00
(A)dd Employee or (M)ain Menu? M
MAIN MENU
1.) Employees
2.) Sales
3.) Quit
Choice? 2
(A)dd Customr, Enter a (S)ale,(V)iew Customer, or (M)ain Menu? S
Error: No Customers.
(A)dd Customr, Enter a (S)ale,(V)iew Customer, or (M)ain Menu? V
Error: No Customers.
(A)dd Customr, Enter a (S)ale,(V)iew Customer, or (M)ain Menu? A
Name: LA PIG
Email: lpig@ca.gov
Phone: 555-6666
(A)dd Customr, Enter a (S)ale,(V)iew Customer, or (M)ain Menu? S
1.) LA PIG
Choice? 1
Item: Shotgun
Quantity: 1
Cost: 195.00
(A)dd Customr, Enter a (S)ale,(V)iew Customer, or (M)ain Menu? V
1.) LA PIG
Choice? 1
LA PIG Phone: 555-6666
Order History
Item Price Quantity Total
Shotgun 195.001195.00
(A)dd Customr, Enter a (S)ale,(V)iew Customer, or (M)ain Menu? M
MAIN MENU
1.) Employees
2.) Sales
3.) Quit
Choice? 3
~/cs609-program/cpp $
Submission
Your submission will be graded directly from your private replit. The commands I will run to grade your program are:
cd companydb-cpp
make
grade ./companydb
You should try this yourself! This will generate a file called "GRADE.TXT". If this file shows all successful runs, you will receive full marks. I will be grading your programs using this automated grading system, so please be careful to match my input and output as closely as you can! Your grade will be based on the total number of tests your code completes as well as the quality of your code.
 Instructions Replit Folder: companydb-cpp This will be an object oriented C++

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!