Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The Chat - A - While phone company provides service to six area codes and charges the per - minute rates for phone calls shown

The Chat-A-While phone company provides service to six area codes and charges the per-minute rates for phone calls shown in Figure 6-25(below).
Write a program named ChatAWhile 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.
Area Code Per-Minute Rate ($)
2620.07
4140.10
6080.05
7150.16
8150.24
9200.14
Figure 6-25 Per-minute phone call rates

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

Students also viewed these Databases questions

Question

Briefly explain the various types of leadership ?

Answered: 1 week ago

Question

Explain the need for and importance of co-ordination?

Answered: 1 week ago

Question

Explain the contribution of Peter F. Drucker to Management .

Answered: 1 week ago

Question

What is meant by organisational theory ?

Answered: 1 week ago