Question

In: Computer Science

Long-Distance Calls A long-distance provider charges the following rates for telephone calls: Rate Category Daytime (6:00...

Long-Distance Calls A long-distance provider charges the following rates for telephone calls: Rate Category Daytime (6:00 A.M. through 5:59 P.M.) Evening (6:00 P.M. through 11:59 P.M.) Off-Peak (12:00 A.M. through 5:59 A.M.) Rate per Minute $0.07 $0.12 $0.05 Create a C++ program that allows the user to select a rate category and enter the number of minutes of the call, then displays the charges.

Use the following test data to determine if the application is calculating properly:

Rate Category and Minutes Charge

Daytime, 20 minutes $ 1.40

Evening, 20 minutes $ 2.40

Off-peak, 20 minutes $ 1.00

Solutions

Expert Solution

#include<iostream>
using namespace std;

int main(){
   string category;
   int minutes;
   cout<<"Enter a category(Daytime/Evening/Off-peak): ";
   cin>>category;
   cout<<"Enter minutes of call: ";
   cin>>minutes;
   if(category=="Daytime"){
       cout<<"Charge: $"<<1.0*minutes*.07;
   }
   if(category=="Evening"){
       cout<<"Charge: $"<<1.0*minutes*.12;
   }
   if(category=="Off-peak"){
       cout<<"Charge: $"<<1.0*minutes*.05;
   }
   return 0;
}


Related Solutions

this is in excel VB8 Program 3: Long-Distance Calls A long-distance provider charges the following rates...
this is in excel VB8 Program 3: Long-Distance Calls A long-distance provider charges the following rates for telephone calls: Rate Category Rate per Minute Daytime (6:00 A.M. through 5:59 P.M.) $0.07 Evening (6:00 P.M. through 11:59 P.M.) $0.12 Off-Peak (12:00 A.M. through 5:59 A.M.) $0.05 Create an application that allows the user to select a rate category and enter the number of minutes of the call, then displays the charges. Use the following test data to determine if the application...
Long distance telephone calls are normally distributed with a mean of 8 minutes and a      standard...
Long distance telephone calls are normally distributed with a mean of 8 minutes and a      standard deviation of 2 minutes.          If random samples of 25 calls were selected, what is the probability that telephone calls would be between 7.83 and 8.2 minutes? If random samples of 25 calls were selected, what is the probability that telephone calls would be at most 8.2 minutes?       c.   If random samples 100 calls were selected, what is the probability that       telephone calls would be between...
A statistical analysis of​ 1,000 long-distance telephone calls made by a company indicates that the length...
A statistical analysis of​ 1,000 long-distance telephone calls made by a company indicates that the length of these calls is normally​ distributed, with a mean of 280280 seconds and a standard deviation of 3030 seconds. Complete parts​ (a) through​ (d). a. What is the probability that a call lasted less than 230230 ​seconds?The probability that a call lasted less than 230230 seconds is . 0478.0478 . ​(Round to four decimal places as​ needed.) b. What is the probability that a...
A statistical analysis of​ 1,000 long-distance telephone calls made by a company indicates that the length...
A statistical analysis of​ 1,000 long-distance telephone calls made by a company indicates that the length of these calls is normally​ distributed, with a mean of 240 seconds and a standard deviation of 30 seconds. Complete parts​ (a) through​ (d). a. What is the probability that a call lasted less than 180 ​seconds? The probability that a call lasted less than 180 seconds is nothing. ​(Round to four decimal places as​ needed.) b. What is the probability that a call...
The TIV Telephone Company provides long-distance telephone service in an area. According to the company’s records,...
The TIV Telephone Company provides long-distance telephone service in an area. According to the company’s records, the average length of all long-distance phone calls placed through this company in 2015 was 12.44 minutes. The company’s management wants to check if the mean length of the current long- distance calls is different from 12.44 minutes. A sample of 150 such calls placed through the company produced a mean length of 13.71 minutes. The standard deviation of all such calls is 2.65...
WorldCom was a provider of long-distance phone services to businesses and residents. It started as a...
WorldCom was a provider of long-distance phone services to businesses and residents. It started as a small company known as Long Distance Discount Services (“LDDS”) that grew to become the third-largest telecommunications company in the United States due to the management of Chief Executive Officer (“CEO”) Bernie Ebbers. It consisted of an employee base of 85,000 workers at its peak with a presence in more than 65 countries. LDDS started in 1983. In 1985, Ebbers was recruited as an early...
During the morning hours at a catalog sales department, telephone calls come in at the rate...
During the morning hours at a catalog sales department, telephone calls come in at the rate (Poisson) of 40 per hour. Calls that cannot be answered immediately are put on hold. The system can handle 8 callers on hold. If additional calls come in, they receive a busy signal. The 3 customer service representatives who answer the calls spend an average of 4 minutes with a customer (Please show how to calculate the trail and error in excel for part...
telephone calls arrive at an exchange have a poisson distribution at an average rate of one...
telephone calls arrive at an exchange have a poisson distribution at an average rate of one every second. Find the probabilities of the following; a. no calls arriving in a given five-second period b. between four and six calls arriving in the five-second period c. there is atleast one call d. there is at most one call
83. Suppose that the length of long distance phone calls, measured in minutes, is known to...
83. Suppose that the length of long distance phone calls, measured in minutes, is known to have an exponential distribution with the average length of a call equal to eight minutes. a. Define the random variable. X= ________________. b. Is X continuous or discrete? c. μ= ________ d. σ= ________ e. Draw a graph of the probability distribution. Label the axes. f. Find the probability that a phone call lasts less than nine minutes. g. Find the probability that a...
An administrator wanted to study the utilization of long-distance telephone service by a department. One variable...
An administrator wanted to study the utilization of long-distance telephone service by a department. One variable of interest (let’s call it X) is the length, in minutes, of long-distance calls made during one month. There were 38 calls that resulted in a connection. The length of calls, already ordered from smallest to largest, are presented in the following table. 1.6 1.7 1.8 1.8 1.8 2.1 2.5 3.0 3.0 4.4 4.5 4.5 5.9 7.1 7.4 7.5 7.7 8.6 9.3 9.5 12.7...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT