Program Statement
Program Statement
The
class has Getdist (int, float) to get the specified value in object, Showdist () to display
distance object in feets’ inches” format. Write main () function to create two distance
objects. Get the value in two objects and display all objects.
Question 3 Create a class named TIME that has hours, minutes and seconds data members
as integer. The class has settime (int, int, int) to set the specified value in object, showtime
() to display time object in hh:mm:ss format. Write main () function to create two time
objects. Set the value in two objects and display all time objects.
Question 4 Create a class Person that has three data members Pid, Pname, PSalary with
appropriate data type. Person class also contains the member functions: getdata() function is
used to input values, showdata() function is used to display value, setdata() function is used
to set the values of data members using parameters, getSalary() function is used to return the
value of person salary. The program should create three objects of the person class and input
values for these objects. The program display the details of highest salary holder person.
Question 5 Write a class Employee with three data members Eid type int, Ename type string
and Esalary type double. It also contains the following member function:
• The get() function is used to input values
• The show() function is used to display values
• The set() function is used to set the values of data members using parameters
• The returnSalary() function is used to return the salary of employee.
The program should create two object of the employee class, input the values and display the
record of that employee whose monthly salary is greater.
Question 6 Write a program that declare a class Student with five data members to store five
subject mark of student. Class also includes three member function for input marks, Sum() to
calculate and return the sum of five subject and Avg() to calculate and return the average
marks of five subject. Each subject has a maximum of 100 marks. Use this class in your
program.