Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++ Programming Language Write a program that will calculate the cost of a phone call as follows: -The first 10 minutes are charged at

In C++ Programming Language

Write a program that will calculate the cost of a phone call as follows:

-The first 10 minutes are charged at a flat rate of $0.99 for the entire 10 minutes (Not 99 cents a minute - but 99 cents for the first 10 minutes total).

-Every minute after the initial 10 minutes will be charged at $0.10 per minute.

-Input the number of minutes talked as an integer.

-Using an IF/ELSE structure, check for an entry of 0 minutes first, and inform the User that no minutes were entered. -IF 0 minutes are entered THEN

-output an error message stating that no minutes were entered.

-ELSE

Calculate and display the results.

The final display will show the minutes and the final cost.

The price will be formatted with 2 decimal places.

-END IF

- Add the code necessary to allow the display window to stay open until you press a key from the keyboard:

system ("pause");

Include all Prologue information with your program

Include Input, Output, and Formulas (if there are any)

Test your program thoroughly with the following data:

1. 9 minutes 2. 10 minutes 3. 11 minutes 4. 35 minutes

DO NOT use the "return 0" code, end, break, or exit to force an exit from within your IF/ELSE structure.

Let the program progress to the end of the main function.

The end of the main function is the only place that the return 0 should be placed.

A switch statement is the only place that the break command should be placed.

Declare all variables within the data declaration section.

DO NOT get input on the same line as a variable declaration.

DO NOT place an equation for computation on the same line as declaring a variable.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

1. Identify three communication approaches to identity.

Answered: 1 week ago

Question

d. Who are important leaders and heroes of the group?

Answered: 1 week ago

Question

3. Describe phases of minority identity development.

Answered: 1 week ago