1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
sineoko [7]
3 years ago
5

Here is the problem specification: An Internet service provider has three different subscription packages for its customers: Pac

kage A: For $9.95 per month 10 hours of access are provided. Additional hours are $2.00 per hour. Package B: For $14.95 per month 20 hours of access are provided. Additional hours are $1.00 per hour. Package C: For $19.95 per month unlimited access is provided. Write a program that calculates a customer's monthly bill. It should ask which package the customer has purchased and how many hours were used. It should then display the total amount due. Input Validation: Be sure the user only selects package A, B or C. Also, the number of hours used in a month cannot exceed 744. Use switch.
Computers and Technology
1 answer:
Andrej [43]3 years ago
6 0

Answer:

In C++:

#include <iostream>

using namespace std;

int main(){

   int hour; char pkg; float bill = 0;

   cout<<"Package: "; cin>>pkg;

   cout<<"Hour: "; cin>>hour;

   if(hour<=744 && hour >=0){

       switch (pkg) {

           case 'A':

               bill = hour * 9.95;

               if(hour >10){bill = 10 * 9.95 + (hour - 10) * 2;}

           break;

           case 'B':

               bill = hour * 14.5;

               if(hour >10){bill = 20 * 14.5 + (hour - 20) * 1;}

           break;

           

           case 'C':

               bill = 19.95;

           break;

           

           default:

               cout << "Package must be A, B or C";}

cout<<"Total Bills: $"<<bill; }

else{ cout<<"Hour must be 0 - 744"; }

return 0;

}

Explanation:

This declares all variables:    int hour; char pkg; float bill=0;

This prompts the user for package type:  cout<<"Package: "; cin>>pkg;

This prompts the user for number of hours:    cout<<"Hour: "; cin>>hour;

This checks if hour is between 0 and 744 (inclusive)

   if(hour<=744 && hour >=0){

If true, the following is executed

A switch statement to check valid input for package

       switch (pkg) {

For 'A' package

           case 'A':

Calculate the bill

<em>                bill = hour * 9.95;</em>

<em>                if(hour >10){bill = 10 * 9.95 + (hour - 10) * 2;}</em>

End of A package:            break;

For 'B' package

           case 'B':

Calculate the bill

<em>                bill = hour * 14.5;</em>

<em>                if(hour >10){bill = 20 * 14.5 + (hour - 20) * 1;}</em>

End of B package:<em>            </em>break;

For C package            

           case 'C':

Calculate bill:                bill = 19.95;

End of C package:            break;

If package is not A, or B or C

           default:

Prompt the user for valid package                cout << "Package must be A, B or C";}

Print total bills: cout<<"Total Bills: $"<<bill; }

If hour is not 0 to 744: <em>else{ cout<<"Hour must be 0 - 744"; }</em>

You might be interested in
How to get amount after a percentage increase in excel​
Tresset [83]

Answer:

First: work out the difference (increase) between the two numbers you are comparing.

Increase = New Number - Original Number.

Then: divide the increase by the original number and multiply the answer by 100.

% increase = Increase ÷ Original Number × 100.

Explanation:

3 0
2 years ago
Read 2 more answers
3. Creat an Algorithm and Flowchart that will accept temperature in Kelvin then convert to celcius. Using the formula:
ehidna [41]

Answer:

.

Explanation:

nsjajanabdmwkqiahsb

5 0
3 years ago
ABC incorporated wants to implement a TCP/IP network for its only site. It has 180 employees and two buildings and requires Inte
riadik2000 [5.3K]

Answer:

A private IP address should be implemented but a PAT and a static NAT should be configured for the computers and the intermediate devices respectively.

Explanation:

There are two types of IP addresses, they are public and private addresses. The public address is an IP4 address routable on the internet while the private address is not routable.

Internet service providers do charge for the use of public IP addresses they render, which can be very costly. To reduce the company's expenses on the internet, the company is networked with private addresses and are mapped for network address translation ( NAT) which assigns a public global address to devices accessing the internet.

5 0
3 years ago
Technician A says that a camshaft must open and close each valve at exactly the right time relative to piston position. Technici
morpeh [17]
On single and double overhead cam engines, the cams are driven by the crankshaft, via either a belt or chain called the timing belt or timing chain. These belts and chains need to be replaced or adjusted at regular intervals.
3 0
3 years ago
A common problem in record systems is inaccurate classification of records as they are created and revised. a. True b. False
Mashcka [7]

Answer:

True.

Explanation:

The whole point of keeping records is to be able to check back on them at a later time. This is why records are kept in such a way/in such an order that it would be absolutely easy to locate them when required.

Inaccurate classification defeats the whole purpose of record keeping as it makes it hard (impossible at times) to locate such record that has been mistakenly classified.

7 0
4 years ago
Other questions:
  • You listened to a song on your computer. Did you use hardware or software? Explain.
    11·2 answers
  • What is my credit card billing zip code??
    15·1 answer
  • Can Someone give me a 5 paragraph essay about all of the uses in Microsoft Word.
    9·1 answer
  • 17) you need to locate an article that (1) is published by a university or proffessional association(2) is authored by clearly d
    6·1 answer
  • Text can be easily moved from one location to another using _____.
    15·1 answer
  • Suppose we perform a sequence of n operations on a data structure such that if some condition C(k) holds then the kth operation
    7·1 answer
  • Explain what middleware is. Name a common middleware in two-tier client/server architecture for database applications.
    10·1 answer
  • Tascake Gets Free Brainliest Because he didnt get it<br><br> Tascake Heres Brainliest
    6·2 answers
  • True or Fale A criminal defense attorney's main focus is to convict the accused of a crime, and a state prosecutor is to defend
    12·2 answers
  • What does business informWhat does business information management do?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!