Question: Write a class, SolarPanels, using the following specifications: Must have the following private attributes: o name of type String o number of type int o

Write a class, SolarPanels, using the following specifications: Must have the following private attributes: o name of type String o number of type int o energy of type double o static variable lossRate of type double Must have a default constructor that: Must have a parameterized constructor that: o Accepts parameters for all parameters o The parameterized constructor uses these parameters to set the attributes

Must have accessors and mutators for the above attributes Must have a method that calculates the totalEnergy() produced, where total energy=number of panels * 250 - (loss amount) the result will be in watt/hour Override the toString method Implements the Comparable interface and compare between panels objects based on energy produced Write a class, TestSolarSystem, to the following specifications: Must have a main program Create three objects of class SolarPanel named Panel1 using the default constructor Read their information form the user Print on screen a report about each object energy production per hour and the summation of all objects energy productions. NOTE: Use the Scanner class to get the input from the user.

please use Java

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!