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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started