Answered step by step
Verified Expert Solution
Link Copied!

Question

...
1 Approved Answer

In C + + ; Long - Distance Calls A long - distance carrier charges the following rates for telephone calls: Write a program that

In C++;
Long-Distance Calls
A long-distance 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 floating-point number in the form
HH.MM.
For example, 07:00 hours will be entered as 07.00, and 16:28 hours will be entered as 16.28.
Input Validation: The program should not accept times that are greater than 23:59. Also, no number whose
last two digits are greater than 59 should be accepted.
Hint: Assuming num is a floating-point variable, the following expression will give you its fractional part:
num - static_cast 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' insertion/extraction 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.Long-Distance Calls
A long-distance carrier charges the following rates for telephone calls:
Starting Time of Call Rate per Minute
00:0006:590.05
07:0019:000.45
19:0123:590.20
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 floating-point number in the form HH.MM. For example, 07:00 hours will be entered as 07.00, and 16:28 hours will be entered as 16.28.
Input Validation: The program should not accept times that are greater than 23:59. Also, no number whose last two digits are greater than 59 should be accepted.
Hint: Assuming num is a floating-point variable, the following expression will give you its fractional part:
num static_cast(num)
1Ii. 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.
2. 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.
2. Implement Constructors, Destructor, Copy Constructor, mutators, and accessor functions in your code.
3. Overload operators insertion/extraction in your classes.
4. 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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Write a definition of Deontological Ethics

Answered: 1 week ago

Question

what is included on form 990

Answered: 1 week ago