Sei sulla pagina 1di 2

University of Engineering and Technology, Abbottabad Campus

Course: Object Oriented Programming (ELE 101)

Course Insructor: Ms.Sundas Shujah

Semester: 2, Spring 2018 Assignment: 01

Last Date of Submission: April 1st,2018 Total Marks: 15

Instructions:

1: Try to submit assignment within due date, there will be no extension.

2: Read questions carefully and fulfill all the requirements of the program.

3: Neatness and clarity will be considered and marked. Assignment should be implemented in MS
visual 2008/2015 and hard copy should be submitted on due date before 10:00 a.m. Attach results
of consoles and code in assignment and demo will be taken in lab class.

4: Give genuine names to variables and classes or wherever there is any declaration; to make it easy
to understand otherwise marks will be deducted. (e.g salary should be int salary not int a,b z etc etc).

5: implement checks wherever possible using && and || conditions in proper structure of your
choice. (switch, if else or do while loop)

6: Copied assignments will be marked 0


Question:

1: Create a class named EmployeeData. The functions of class should include three functions,
GetData, CalculateSalary and display data. The object of class created will be array of objects of size
of your choice. (e.g EmployeeData employee[100];)

2: The program should take input from user for employee name, Designation, marital status (m for
married and s for single) and scale (16 to 19) through get data function.

3: Calculate salary function should calculate salary based on scale entered by user and save it as
employee salary. See table for payments for different scales. (hint: use conditional statements based
on scales, also call calculate salary within get data function).

4: Display data function should display all the data entered and calculated salaries. (use for loop)

Note:

In main create a menu that asks the user to choose a choice among, enter data and display data.
The program should ask user again and again whether he wants to input more data until he selects
N. (hint: e.g do you want to enter more data? (y/n) using while loop).

Employee Scale Basic Pay House Rent Medical allowance


16 20,000 10,000 5000
17 30,000 20,000 6000
18 40,000 25,000 8000
19 50,000 35,000 11000
20 60,000 45000,000 10000
Total salary = Basicpay+HouseRent+MedicalAllowance

Potrebbero piacerti anche