Create two classes employee and departments

Assignment Help Programming Languages
Reference no: EM131564554

Assignment

Write a program to allow the user to:

1. Create two classes. Employee and Departments.

The Department class will have: DepartmentID, Departmentname, DepartmentHeadName.

The Employee class will have employeeID, 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 7 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.

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.

Please make sure that when the user tries to exit the program without having saved the data, alert the user that the data has not been saved and will be lost. Proceed only if the user consents.

Reference no: EM131564554

Questions Cloud

Snapshot for the cis countries : View article Economic Snapshot for the CIS Countries by Angela Bouzanis and give explain the following:
How high will the pile be : A piece of paper 0.0040 in. thick is cut in half. These two pieces are then placed one on the other and cut in half. If this is repeated such that the paper.
What can you do to help them transition : What can you do to help them transition into a project management role?The cost was not taken into consideration in the project budget.
How does port facility technology interface : How does port facility technology interface with homeland security
Create two classes employee and departments : Create two classes. Employee and Departments. Make sure the department ID does not already exist in the array containing Department objects.
How far does object travel while stopping : After the power is turned off, an object on a nearly frictionless surface slows down such that it travels 99.9% as far during 1 s as during the previous second.
Assume that interest rate parity holds : Assume that interest rate parity holds. What is the yield on 180-day risk-free securities in the United States?
Develop organisations remuneration strategy : BSBHRM505 Manage remuneration and employee benefits - Develop organisations remuneration strategy and Conduct research on a selected superannuation fund
How creative expressions can broaden your perspective : how creative expressions can broaden your perspective. You will do this by reflection on the impact that television and video art had upon a person

Reviews

Write a Review

Programming Languages Questions & Answers

  Program display meal cost and tax amount

The program should then display the meal cost,taxAmt, and total bill respectively and use named constants Tax and tip to initialize the tax and the tip values.

  Create a serial sequence detector

You are to create a "Serial Sequence Detector". Your design will take in clock, reset, and one-bit data signal. Your design will check input data signal on rising edge of the input clock.

  What is the tokens

Identify the tokens in each of the following statements. (You do not need to classify them; just identify them.) if (a == b1) a = x + y.

  Create and write payroll program to prompt user for input

Create and write a payroll program that will prompt the user to enter employee's hourly pay rate and the number of hours worked.

  Write functions to change and display attributes

Write class player which contains attributes for players name,average and team. Write three functions to change and display these attributes.

  Calculate and print the annual salary of the employee

Calculate and print the annual salary of the employee. suppose employee receive 6% increase in pay. Calculate and print net pay giving the pay rate and hours work. Suppose deductions amount to 9% of the gross pay.

  Write a program that draws a picture of a house

Write a program that draws a picture of a house. It could be as simple as the accompanying figure, or if you like, make it more elaborate (3-D, skyscraper, marble columns in the entryway, whatever).

  Develop program that simulates section of a restaurant menu

Develop a console program that simulates a section of a restaurant menu. Each item will have a different price and your program should define at least ten (10) items. You will need to obtain an order from the user who should provide their menu sel..

  Produce a project plan

Produce a project plan and an interim description of the project development

  Calculate and display optimal cost for cylindrical container

Compute and display the height and cost of container. Use the following formulas, where V is volume, r is radius, h is the height, and C is the cost.

  Create a program that prints a book

Create a program that prints a book. The book consists of the following components: A title and author and  Three chapters

  Write down pseudo code to find sentinel value

The total of both types have to be printed at end. Suppose 50 as sentinel value. Write down Pseudo Code to perform this function.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd