CS201 – Homework 1 – International Phone Roaming Costs Solved

35.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: zip solution files instantly, after Payment

Securely Powered by: Secure Checkout

Description

Rate this product

 

 

Programming Language/Environment

You should prepare (or at least test) your program using MS Visual Studio 2012 C++. We will use the standard C++ compiler and libraries of the above mentioned platform while testing your homework.

Input and Output

There are nine inputs in this program:

  • Name of the user (of type string),
  • Price of outgoing call per minute in TL (of type double),
  • Number of minutes talked as outgoing calls (of type int),
  • Price of incoming call per minute in TL (of type double),
  • Number of minutes talked as incoming calls (of type int),
  • Price of internet usage per MB in TL (of type double),
  • GBs of internet used (of type double),
  • Price of one international SMS in TL (of type double),
  • Number of SMS’s sent (of type int).

Seven outputs are expected in this program, all in terms of TL:

  • Money spent for outgoing calls (of type double),
  • Money spent for incoming calls (of type double),
  • Money spent for the internet usage (of type double),
  • Money spent for the SMS’s (of type double),
  • Total cost of all roaming services (of type double), The tax imposed, 18% of the total cost (of type double),
  • Total roaming bill fee including the tax (of type double).

Program Flow

At the beginning, the user will be prompted to enter his/her name as the first input. The name of the user should be displayed whenever appropriate in the prompts and the output text. See Sample Runs section for some examples.

User will first input his/her name. After that, two prompts will be received that want the user to enter the price of outgoing call per minute and the minutes talked as outgoing call. Then, your program will calculate and display the amount spent for outgoing calls while roaming. After that, two other prompts will be received that want the user to enter the price of incoming call per minute and the minutes talked as incoming call. Then, your program will calculate and display the amount spent for incoming calls while roaming. After that, another two prompts will be received that want the user to enter the price of internet usage per MB and the number of GB’s of internet used while roaming. Then, your program will calculate and display the amount spent for internet usage while roaming. Thereafter, another two prompts will be received that ask for the user to enter the price of one SMS and the number of SMS’s sent. Then, your program will calculate and display the amount spent for the SMS’s. See Sample Runs section for some examples.

Then, your program should also calculate and display the remaining expected outputs: total cost of all the used services, the tax imposed on it (18% of the total cost) and the total bill fee including the tax.

Please refer to the Sample Runs section to see the program flow.

Input Check

You do not need to perform any kind of input checks; you may assume that the user enters positive values correctly for all inputs.

Sample Runs

Below, we provide some sample runs of the program that you will develop. The italic and bold phrases are inputs taken from the user. You should follow the input order in these examples and the text your program will display must be exactly the same as in the following examples.

Sample Run 1

Please enter your name: Gulsen

Gulsen, please enter the price for outgoing call per minute: 10

Gulsen, please enter how many minutes you have talked in outgoing calls: 5

Gulsen, you have spent 50 TL for outgoing calls you made while you are abroad.

Gulsen, please enter the price for incoming call per minute: 3

Gulsen, please enter how many minutes you have talked in incoming calls: 12 Gulsen, you have spent 36 TL for incoming calls you made while you are abroad.

Gulsen, please enter the price for internet usage per MB: 5

Gulsen, please enter how many GBs you have used: 1

Gulsen, you have spent 5120 TL for the internet while you are abroad.

Gulsen, please enter the price for one SMS: 1

Gulsen, please enter the number of SMS you have sent: 7

Gulsen, you have spent 7 TL for the SMS while you are abroad.

Gulsen, total cost for all roaming services is 5213 TL.

Gulsen, tax is 938.34 TL.

Gulsen, total roaming bill fee with tax is 6151.34 TL.

Sample Run 2

Please enter your name: Ece

Ece, please enter the price for outgoing call per minute: 4.90

Ece, please enter how many minutes you have talked in outgoing calls: 17

Ece, you have spent 83.3 TL for outgoing calls you made while you are abroad.

Ece, please enter the price for incoming call per minute: 2.90

Ece, please enter how many minutes you have talked in incoming calls: 8 Ece, you have spent 23.2 TL for incoming calls you made while you are abroad.

Ece, please enter the price for internet usage per MB: 5

Ece, please enter how many GBs you have used: 0.028

Ece, you have spent 143.36 TL for the internet while you are abroad.

Ece, please enter the price for one SMS: 0.95

Ece, please enter the number of SMS you have sent: 5

Ece, you have spent 4.75 TL for the SMS while you are abroad.

Ece, total cost for all roaming services is 254.61 TL.

Ece, tax is 45.8298 TL.

Ece, total roaming bill fee with tax is 300.44 TL.

 

  • HomeWork1-bjyzuk.zip