All Constructors set the UID number

computer science

Description

Constructors (All) Constructors: set the UID number EnergyMonitor() - create a module with the default name “MyEnergyMonitor” EnergyMonitor(String name) - create a module with the specified name Queries: String getName() - get name of the file boolean isOn() - returns true/false power is flowing double getPower() - get average power over last 10 seconds (as a simplication, assume this method is called every 10 seconds). Assume that the method is called at the end of a 10 second boundary. This should be the only place where power is computed so that sampling of power every 10 seconds is preserved for purposes of computing energy and whether or not there is a load attached. double getEnergy() - get the watt hours delivered to the load since creation or last reset (considering all energy until the last getEnergy() invocation) long getUID() - get the UID of this object String toString() - returns a string " with UID : Watts, Watt Hours" perhaps something like "MyEnergyMonitor with UID 1000: 10.20 Watts, 100 Watt Hours" Commands: setLoad(double resistance) - set the load on the energy monitor (in ohms), negative values mean no load setName(String newName) - set a new name for the energy monitor, object no longer backed up if name changed reset() - reset the energy accumulation Like all other modeling objects, the EnergyMonitor should not not contain I/O.

Instruction Files
p2 (2).pdf
79.9 KB

Related Questions in computer science category


Disclaimer
The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.