Question: cpp file: BatteryObj.cpp Define Battery class as follows: class Battery { public: Battery() {} // default constructor Battery(float voltage, float energy_joules, float curr_joules); bool powerDevice(float

cpp file: BatteryObj.cpp

Define Battery class as follows:

class Battery { public: Battery() {} // default constructor Battery(float voltage, float energy_joules, float curr_joules);

bool powerDevice(float current_amps, float time_secs); float maxTime(float current_amps); void reCharge();

private: float voltage; float energy_joules; float curr_joules;

friend istream& operator >> (istream&, Battery&); friend ostream& operator << (ostream&, const Battery&);

};

In main()

Display Battery specs use overload function operator<< Use the battery to power a 4-Amp light for 15 minute - powerDevice() CHECK how much battery power is left to operate an 8-Amp device - maxTime() RECHARGE the Battery - reCharge() FIND how long a FULLY RECHARGED battery can operate an 8-Amp device - maxTime

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!