Starting from:

$25+

Homework 2: Problem solving, conditionals.


Topics: Problem solving, conditionals.

Write a program that computes your phone bill for the month. Your bill is based on the number of hours of phone use, along with your package. Here are the different packages:

--------------------------------------------------------------------------
Basic package: For $9.95 per month 10 hours of access are provided. Additional hours are $2.00 per hour.

Gold package: For $14.95 per month 20 hours of access are provided. Additional hours are $1.00 per hour.

Platinum package: For $19.95 per month unlimited access is provided.
--------------------------------------------------------------------------

Write a program that ask the user to enter their package plan, along with the total hours they have used for the month. Then, tell the user how much their bill is for the month.



Example run 1:

Welcome to the RobCast Phone Company!

Which package plan are you subscribed to?
gold

Gold, eh? Ok, how many hours did you spend blabbing on the phone this month?
23

Wow, 23 hours!?!? You've got a problem dude! Anyway, your total bill is $17.95.


Example run 2:

Welcome to the RobCast Phone Company!

Which package plan are you subscribed to?
basic

Basic, eh? Ok, how many hours did you spend blabbing on the phone this month?
237

Wow, 237 hours!?!? You've got a problem dude! Anyway, your total bill is $463.95.


Example run 3:

Welcome to the RobCast Phone Company!

Which package plan are you subscribed to?
gold

Gold, eh? Ok, how many hours did you spend blabbing on the phone this month?
19

Wow, 19 hours!?!? You've got a problem dude! Anyway, your total bill is $14.95.

More products