BuiltWithNOF
Phone Charge

Your task is to write a program to determine the cost of a long distance phone call, based on the following information. Use the movie example as a guide. You will need to turn in a copy of your Decision table,  a listing of your program, and 2 examples of your output. This will be due next Monday, but you should get a good start on it before class tomorrow.

 

Long distance calls cost 20 cents per minute for region 1 for the first 5 minutes, then 5 cents per minute after 5 minutes.  For region 2, it is 30 cents per minute for the first 5 minutes and 6 cents per minute after that. If you call starts after 10pm, your call will be half price, for both regions.  If you have a preferred calling card, you get a $2 credit for each call (if the call is more then $2).  A call over 60 minutes will be assessed a $3 surcharge for both regions.  For Holidays, every call is charged at a flat rate of 8 cents per minute for both regions and for any length of call.  

 

Example output:

   enter region      1
   enter time          53
  
preferred card?  yes
   After 10pm?      
no
   Is it a holiday?  no
  

  Your charge for this call is:  $1.40

  (5 * .20 +  48 * .05 - 2) for region 1

[Home] [Syllabus] [Sessions] [Writing Code] [Help] [Setup] [Instructor]