Question: In C + + ; Long - Distance Calls A long - distance carrier charges the following rates for telephone calls: Write a program that
In C;
LongDistance Calls
A longdistance carrier charges the following rates for telephone calls:
Write a program that asks for the starting time and the number of minutes of the call, and displays the
charges. The program should ask for the time to be entered as a floatingpoint number in the form
HHMM
For example, : hours will be entered as and : hours will be entered as
Input Validation: The program should not accept times that are greater than : Also, no number whose
last two digits are greater than should be accepted.
Hint: Assuming num is a floatingpoint variable, the following expression will give you its fractional part:
num staticcast Design a class named Time that holds three attributes:
a Declare one attribute called hours of integer data type.
b Declare one attribute called minutes of integer data type.
c Declare one attribute called seconds of integer data type.
Design a class named LongDistance that holds two attributes:
a Declare one attribute called startingTimeOfCall of Time datatype.
b Declare one attribute called timeElapsed of Time datatype.
c Implement a member function that calculates the minutes of timeElapsed
variable.
d Compute and display the charges of the call. Use military format time in
your program calculations.
Implement Constructors, Destructor, Copy Constructor, mutators, and accessor
functions in your code.
Overload operators' insertionextraction in your classes.
The solution must contain the following:
a Source code.
b Output Code.
c Tables descriptive for every Class.
d UML diagram of the Classes Composition.
e CRC card.LongDistance Calls
A longdistance carrier charges the following rates for telephone calls:
Starting Time of Call Rate per Minute
::
::
::
Write a program that asks for the starting time and the number of minutes of the call, and displays the charges. The program should ask for the time to be entered as a floatingpoint number in the form HHMM For example, : hours will be entered as and : hours will be entered as
Input Validation: The program should not accept times that are greater than : Also, no number whose last two digits are greater than should be accepted.
Hint: Assuming num is a floatingpoint variable, the following expression will give you its fractional part:
num staticcastnum
Ii Design a class named Time that holds three attributes:
a Declare one attribute called hours of integer data type.
b Declare one attribute called minutes of integer data type.
c Declare one attribute called seconds of integer data type.
Design a class named LongDistance that holds two attributes:
a Declare one attribute called startingTimeOfCall of Time datatype.
b Declare one attribute called timeElapsed of Time datatype.
c Implement a member function that calculates the minutes of timeElapsed variable.
d Compute and display the charges of the call. Use military format time in your program calculations.
Implement Constructors, Destructor, Copy Constructor, mutators, and accessor functions in your code.
Overload operators insertionextraction in your classes.
The solution must contain the following:
a Source code.
b Output Code.
c Tables descriptive for every Class.
d UML diagram of the Classes Composition.
e CRC card.
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
