Overloaded constructor three parameters


Question 1: Write down the class 'Weather' to contain the given:

a) data members: humidity, air_pressure, atmospheric_temperature and wind_speed all of datatype double.

b) a no-argument constructor to initialize the humidity to zero.

c) an overloaded constructor with one parameter to assign a value to the air_pressure.

d) an overloaded constructor with two parameters to assign values to the humidity and air_pressure.

e) an overloaded constructor with three parameters to assign values to the humidity, air_pressure, atmospheric_temperature.

f) an overloaded constructor with four parameters to assign values to each of the variables declared.

g) set methods for each of the data members.

h) get methods for each of the variables.

Question 2: Write down an application to perform the following:

a) Create a 'Weather' object using the no-argument constructor.

b) Create a second 'Weather' object using the overloaded constructor one parameter.

c) Create a third 'Weather' object using the overloaded constructor two parameters.

d) Create a fourth 'Weather' object using the overloaded constructor three parameters.

e) Create a fifth 'Weather' object using the overloaded constructor four parameters.

f) Use the set methods to assign values to each of the variables declared.

g) Display the values using message dialog(s).

Request for Solution File

Ask an Expert for Answer!!
Database Management System: Overloaded constructor three parameters
Reference No:- TGS06131

Expected delivery within 24 Hours