Académique Documents
Professionnel Documents
Culture Documents
4 (Batch: A) JPR(TYIF)
-1-
16. Define a class ‘HardDisk’ having data members type, speed, interface and
capacity. Overload the method ‘find()’ to find speed and capacity of
particular hard disk.
17. Defining the PI (3.14) as static variable find the surface area of cone,
cylinder and area of circle using two different overloaded methods. Use
overloaded constructors to initialize the values
18. Write four different definitions of the method ‘calculateLength()’ to convert
length given in inches, feet, yards and miles to centimeters. Use constructor
to initialize the object. Write all four methods as ‘static’.
19. Define a class ‘College’ having data members: total students, branches and
percentage of total result. Input the data using static method. Class will
contain the constructor. Accept this data for two objects. Create a static
method containing two object parameters and display the data of college
whose result is better.
20. Create a class ‘Printer’ having data members: type, speed and cost.
Initialize these data members using overloaded constructors. Define a static
method containing two objects as parameters to find which printer is
expensive.
-2-