A battery object should know its voltage how much energy it


Please help Design and implement a class to model a battery.

A battery object should know its voltage, how much energy it is capable of storing, and how much energy it is currently storing (in joules).

Include the following member functions. powerDevice:

Given the current of an electrical device (amps) and the time the device is to be powered by the battery (seconds), this function determines whether the battery's energy reserve is adequate to power the device.

If so, the function updates its energy reserve by subtracting the energy consumed and returns the value true.

Otherwise it returns the value false and leaves the energy reserve unchanged. maxTime:

Given the current of an electrical device, the function returns the number of seconds the battery can operate the device before it is fully discharged.

This function does not modify the energy reserve. reCharge: This function sets the battery's component representing the present energy reserve to its maximum capacity.

Use the following equations in your design. p=vi p= power in watts (W) v= voltage in volts (V) w=pt i= current in amos (A) w= energy in joules (J) t= time in seconds (s) For this simulation, neglect any loss of energy in the transfer from battery to device.

Create a main function that tests your class by creating an object to model a 12-V automobile battery with a maximum energy storage of 5x10^6 J.

Use the battery to power a 4-A light for 15 minutes. Then find out how long the battery's remaining energy could power an 8-A device. After recharging the battery, ask again how long it could operate an 8-A device. program is in C++.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: A battery object should know its voltage how much energy it
Reference No:- TGS02889355

Expected delivery within 24 Hours