Professional Documents
Culture Documents
Assignment 01
Marks: 5*5=25
-All students of OOP Section C are requested to submit the solution in Moodle on/before 30 th, October,Friday.
-No submission will be accepted after due date. This is individual assignment.
-on front page must mention your full name, registration and section.
Task 1:
Write a program (using user define functions ) which asks user to select the one of the following operations
while calling void Menu() function in main.
After selecting one of the options program ask two numbers from user and do perform the task accordingly.
Task 2:
A class named “Employee” holds information like employee code, name,gender, year of joining. Write a
program to create three objects of employee and enter some data into it through setters. Make getters and
setters for all employee information. Then ask the user to enter current year. Display the names of those
employees whose tenure is 2 or more than 2 years according to the given current year only using getters.
Task 3:
Page 2 of 2
A class named “Employee” holds information like employee code, name,gender, year of joining. Write a
program to create five hundred objects (Array of employee objects )of employee and enter some data into it
through setters. Make getters and setters for all employee information. Then ask the user to enter current year.
Display the names of those employees whose tenure is 5 or more than 5 years according to the given current
year only using getters.
Note: employee code is automatically assigned to newly created object by calling default constructor
Task 4:
Raising a number to a power p is the same as multiplying n by itself p times. Write a function called power that
takes two arguments, a double value for n and an int value for p, and return the result as double value. Use
default argument of 2 for p, so that if this argument is omitted the number will be squared. Write the main
function that gets value from the user to test power function.
Task 5:
Private members :
name 20 characters
Public members:
READINFO() function to accept values for adno, name, marks. Invoke the function
GETAVG()
You should give function definitions outside the class using scope resolution operator.