Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions