Professional Documents
Culture Documents
INT201 OOP Labsheet 5 2022 2
INT201 OOP Labsheet 5 2022 2
INT201 OOP Labsheet 5 2022 2
2. Using this updated class, write a driver class (program) that reads the value of the
temperature for two objects and,
a. Print the maximum temperature of the two objects,
b. Print the average temperature of the two objects.
EX#2
1. Define a class Account with the following data members, constructors, and methods:
Two data members: ownerName of type String, and balance of type double.
A default constructor.
A constructor with parameters.
A set method for the name.
A set method for the balance.
A method to print the owner name and balance of an account.
A method totalBalance() that takes an object of type Account as a parameter and returns
the sum of the total of two objects of type Account.
Define a method compareAccounts() that one object of type Account as a parameter. The
method should return a copy of the object with the higher balance.