Write a program using method overriding and constructor overriding to do the following tasks. a) Create a class Kelvin with the variables L,M and N. b) Create a constructor to initialize the variables...


Java


Write a program using method overriding and constructor overriding to do the following tasks.<br>a)<br>Create a class Kelvin with the variables L,M and N.<br>b)<br>Create a constructor to initialize the variables L,M and N with 0.0 in each value.<br>c)<br>Create parameterized constructor to receive and initialize the variables L,M and N with values passed from main() method.<br>d)<br>Create a method getData() in Kelvin class to calculate and print the value of N using the formula.<br>N = 3L* – 4/M<br>e)<br>Inherit a subclass with the name Celsius and declare a variable P in the subclass. Create a parameterized constructor to receive and<br>initialize the values of the variables L ,M and P. Override the super class parameterized constructor to receive the values of the variables<br>L,M and P.<br>f)<br>Override the method getData() to calculate and print the value of N using the formula<br>N = 3L4 – 4/M +P<br>g)<br>Create an object to call the method getData() defined in the superclass. Also create another object to call the method getData()<br>defined in the subclass.<br>

Extracted text: Write a program using method overriding and constructor overriding to do the following tasks. a) Create a class Kelvin with the variables L,M and N. b) Create a constructor to initialize the variables L,M and N with 0.0 in each value. c) Create parameterized constructor to receive and initialize the variables L,M and N with values passed from main() method. d) Create a method getData() in Kelvin class to calculate and print the value of N using the formula. N = 3L* – 4/M e) Inherit a subclass with the name Celsius and declare a variable P in the subclass. Create a parameterized constructor to receive and initialize the values of the variables L ,M and P. Override the super class parameterized constructor to receive the values of the variables L,M and P. f) Override the method getData() to calculate and print the value of N using the formula N = 3L4 – 4/M +P g) Create an object to call the method getData() defined in the superclass. Also create another object to call the method getData() defined in the subclass.

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here