c++ output

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

c++ output

Post by answerhappygod »

c++
C Output 1
C Output 1 (192.58 KiB) Viewed 25 times
output
C Output 2
C Output 2 (180.65 KiB) Viewed 25 times
C Output 3
C Output 3 (130.22 KiB) Viewed 25 times
C Output 4
C Output 4 (133.73 KiB) Viewed 25 times
C Output 5
C Output 5 (136.42 KiB) Viewed 25 times
1. Create two classes. Employee and Departments. The Department class will have: DepartmentID, Departmentname, DepartmentHeadName. The Employee class will have employeeld, emploeename, employeesalary, employeeage, employeeDepartmentID. Both of the above classes should have appropriate constructors, accessor methods. 2. Create two arrays. One for Employee with the size 5 and another one for Department with the size 3. Your program should display a menu for the user to do the following: 1. Create Department. Collect all information about a department. Make sure the department ID does not already exist in the array containing Department objects. If it does not, then insert the Department object into the array. When the array is full, display the error message to the user "The array is full, you can not add any more departments" 2. Create Employee. Collect all information about an Employee. Make sure the Employee ID does not already exist in the array containing Employee objects. If it does not, then insert the Employee object into the array. Also make sure that the DepartmentID that the employee belongs also exists. If it does not, then display error message. When the array is full, display the error message to the user "The array is full, you can not add any more Employees" 3. Write the data to the file. When the user selects this option, dump the information in each array into a separate file. 4. Retrieve data from file. When user selects this option, open each file, load the data from the file into the appropriate array. 5. Display Report: When user selects this option, go through arrays and display the total salary paid for each department. The report should display the department name and the total salary of all employees in that department
TEST CASE1: : 1. Create Department 2. Create Employee 3. Write Out Data File 4. Read In Data File 5. Display Salary Report 6. Quit Please make a selection : 1 Please Enter Department Details: Department ID 1 Department Name : Sales Head of Department : : Anna 1. Create Department 2. Create Employee 3. Write Out Data File 4. Read In Data File 5. Display Salary Report 6. Quit Please make a selection : 1 Please Enter Department Details: Department ID : 1 Value must be unique! 1. Create Department 2. Create Employee 3. Write Out Data File 4. Read In Data File 5. Display Salary Report 6. Quit Please make a selection : 1 Please Enter Department Details: Department ID 2 Department Name : Marketing Head of Department : Mark 1. Create Department 2. Create Employee 3. Write Out Data File 4. Read In Data File 5. Display Salary Report 6. Quit Please make a selection : 1 Please Enter Department Details: Department ID : 3 Department Name : GlobalSales Head of Department : Patil 1. Create Department 2. Create Employee 3. Write Out Data File 4. Read In Data File 5. Display Salary Report 6. Quit Please make a selection : 1 --- : 8 --
Please Enter Employee Details: Employee ID : 3 Employee Name : Adam Salary: $50000 Age : 24 Department ID : 2 1. Create Department 2. Create Employee 3. Write Out Data File 4. Read In Data File 5. Display Salary Report 6. -- Quit Please make a selection : 2 Please Enter Employee Details: Employee ID : 4 Employee Name : Manny Salary: $60000 Age : 26 Department ID : 2 1. Create Department 2. Create Employee 3. Write Out Data File 4. Read In Data File 5. Display Salary Report 6. Quit Please make a selection : 2 Please Enter Employee Details: Employee ID : 5 Employee Name : Maria Salary: $60000 Age : 23 Department ID : 9 Please enter a valid department ID: 3 1. Create Department 2. Create Employee 3. Write Out Data File 4. Read In Data File 5. Display Salary Report Quit Please make a selection : 2 The array is full, you can not add any more Employees. 1. Create Department 2. Create Employee 3. Write Out Data File 4. Read In Data File 5. Display Salary Report 6. -- Quit Please make a selection : 5 6. --
-- : The array is full, you can not add any more Departments. 1. Create Department 2. Create Employee 3. Write Out Data File 4. Read In Data File 5. Display Salary Report 6. Quit Please make a selection : 2 Please Enter Employee Details: Employee ID : 1 Employee Name : John Salary: $45000 Age : 25 Department ID : 1 1. Create Department 2. Create Employee 3. Write Out Data File 4. Read In Data File 5. Display Salary Report 6. -- Quit -- Please make a selection : 2 Please Enter Employee Details: Employee ID : 1 Value must be unique! 1. Create Department 2. Create Employee 3. Write Out Data File 4. Read In Data File 5. Display Salary Report 6. -- Quit Please make a selection : 1 The array is full, you can not add any more Departments. 1. Create Department 2. Create Employee 3. Write Out Data File 4. Read In Data File 5. Display Salary Report 6. -- Quit -- Please make a selection : 2 Please Enter Employee Details: Employee ID : 2 Employee Name : Susan Salary: $45000 Age : 26 Department ID : 1 1. Create Department 2. Create Employee 3. Write Out Data File 4. Read In Data File 5. Display Salary Report 6. -- Quit -- Please make a selection : 2.
Salary Report By Department Dept : Sales Total Salary: $90000 Dept : Marketing Total Salary : $110000 Dept : GlobalSales Total Salary : $60000 1. Create Department 2. Create Employee 3. Write Out Data File 4. Read In Data File 5. Display Salary Report 6. Quit Please make a selection : 9 Please enter a valid choice (1 - 6): 3 1. Create Department 2. Create Employee 3. Write Out Data File 4. Read In Data File 5. Display Salary Report 6. Quit Please make a selection : 6 Thank you, goodbye.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply