You are on page 1of 2

Assignment 4

1. Write a program to implement a class to store details related to a


Student. The Student class contains the following information of a student.
 rollno
 name
 address
 father name
 age
 contact number
 nationality
 branch
 section

Create an instance of the class and print all the details of a student after
assigning the values.

2. Write a class to implement the following:


Create a class Employee
The Employee class contain properties to store the following
 ID
 Name
 Designation
 Department
 Basic Salary
 HRA (House Rent Allowance)
 VA (Vehicle Allowance)
 NetSalary

The Employee class contain methods to perform the following job


 Store the value of all the properties individually
 Get the value of all the properties individually
 Calculate HRA and VA after assigning the value of Basic Salary
 Calculate Net Salary after allowances calculations
 Display all the properties of an employee.
3. Create a class student having data member as:
 rollNumber- int
 name-String
 address-String
Then create starter class, in which-
1) Create 3 instances of student class.
2) Assign values to data members for each object.
3) Print values using reference variable.
4) Create 2 aliases for each of them.
5) Change the values of data members for each object using aliases.
6) Print the values for each object with all aliases.
7) At end each object must be able to refer only with any one reference variable

You might also like