William Langly

William Langly

  • NA
  • 32
  • 4.8k

Having Trouble With Array

Oct 25 2017 11:56 AM
I need help writing a program that stores the area codes and rates in parallel arrays and allows a user to enter an area code and the length of time for a call in minutes, and then display the total cost of the call.
 
For example if the area code is in the array, such as 715, and the call length is 22 minutes, the output should be:
 
Your phone call to area 715 costs $0.16 per minute For 22 minutes the total is $3.52
 
If the area code is not in the array, such as 111, the program should not accept a call length, and instead output "Sorry - no calls allowed to area 111". 

Answers (1)