Course Solutions Uncategorized (Solved) : 02 Define Class Named Planet Contains Two Instance Variables Store Name Planet Name Number Q30707494 . . . .

(Solved) : 02 Define Class Named Planet Contains Two Instance Variables Store Name Planet Name Number Q30707494 . . . .

 

02. (a) Define a class named Planet, which contains two instance variables that store the name of a planet (name) and the number of days the planet takes to travel around the Sun (travelDays). Write a method printPlanet O which displays the planets details. In addition, write a test class to test your Planet class. (6 marks) le output for driver Ester the Enter the days: 36 Planet Nase: Earth Days:6 Process conpleted (b) Add a calculateAge ) method to your Planet class which calculates a persons age on that planet. Use the following formulac age on the planet 

<div class=

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post