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: companydbcpp
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:
ViewAdd Employees
ViewAdd 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.
~csprogramcpp $ make clean
rm f o companydb
~csprogramcpp $ make
gc companydb.cpp g stdc
gc customer.cpp g stdc
gc employee.cpp g stdc
gc person.cpp g stdc
gc purchase.cpp g stdc
gg stdcc o company.o company.cpp
go companydb companydb.o customer.o employee.o person.o purchase.o company.o g stdc
~csprogramcpp $ companydb
Company Name: acme
MAIN MENU
Employees
Sales
Quit
Choice?
Wile E Coyote Phone: Salary: $
Road Runner Phone: Salary: $
Add Employee or Main Menu? A
Name: Elmer Fudd
Email: efudd@acme.com
Phone:
Salary:
Wile E Coyote Phone: Salary: $
Road Runner Phone: Salary: $
Elmer Fudd Phone: Salary: $
Add Employee or Main Menu? M
MAIN MENU
Employees
Sales
Quit
Choice?
Add Customr, Enter a SaleView Customer, or Main Menu? A
Name: Babs bunny
Email: bbunny@acmeu.edu
Phone:
Add Customr, Enter a SaleView Customer, or Main Menu? S
Bugs Bunny
Yakko Warner
Babs bunny
Choice?
Item: Anvil
Quantity:
Cost:
Add Customr, Enter a SaleView Customer, or Main Menu? S
Bugs Bunny
Yakko Warner
Babs bunny
Choice?
Item: Dynamite
Quantity:
Cost:
Add Customr, Enter a SaleView Customer, or Main Menu? V
Bugs Bunny
Yakko Warner
Babs bunny
Choice?
Yakko Warner Phone:
Order History
Item Price Quantity Total
Candygram With Explosives
Candygram With Explosives
Anvil
Dynamite
Add Customr, Enter a SaleView Customer, or Main Menu? M
MAIN MENU
Employees
Sales
Quit
Choice?
~csprogramcpp $ companydb
Company Name: newco
MAIN MENU
Employees
Sales
Quit
Choice?
Add Employee or Main Menu? A
Name: Duke Nukem
Email: dnukeum@newco.com
Phone:
Salary:
Duke Nukem Phone: Salary: $
Add Employee or Main Menu? M
MAIN MENU
Employees
Sales
Quit
Choice?
Add Customr, Enter a SaleView Customer, or Main Menu? S
Error: No Customers.
Add Customr, Enter a SaleView Customer, or Main Menu? V
Error: No Customers.
Add Customr, Enter a SaleView Customer, or Main Menu? A
Name: LA PIG
Email: lpig@cagov
Phone:
Add Customr, Enter a SaleView Customer, or Main Menu? S
LA PIG
Choice?
Item: Shotgun
Quantity:
Cost:
Add Customr, Enter a SaleView Customer, or Main Menu? V
LA PIG
Choice?
LA PIG Phone:
Order History
Item Price Quantity Total
Shotgun
Add Customr, Enter a SaleView Customer, or Main Menu? M
MAIN MENU
Employees
Sales
Quit
Choice?
~csprogramcpp $
Submission
Your submission will be graded directly from your private replit. The commands I will run to grade your program are:
cd companydbcpp
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.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
