Question: You are required to write a C + + program that processes an Electric _ Bill class through various operations. Please address the following sub
You are required to write a C program that processes
an ElectricBill class through various operations.
Please address the following subquestions:
Create an ElectricBIll class with the following
specifications:
It should have private attributes for the yearly bill, which
is an int array of years data, and another similar array
for reversed bill data.
In main function, define two int arrays:
and
points
Provide a constructor and initialise two objects
named Comp and Comp using the two arrays above.
Implement a member function of
class ElectricBIll called show to display the raw
yearly bill data, call this function in the main function to
show the bill data of Comp or Comp points
Implement two member functions
of ElectricBIll class:
Write a reverse function to reverse the bill data in
Comp and call this function from main function.
points
Write two member functions named Max and Min
and return the year index of the maximum and minimum
of Comp and call it from the main function eg for
Comp should return points
Overload the operator
in ElectricBill class to calculate the subtraction
of Comp and Comp and use CompComp to return
delta this should be another ElectricBill object
and display the bill data of delta in main function.
points
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
