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]
2 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]2 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
What is the term used for describing the judgement or common sense part of problem solving​
Triss [41]

Answer:

Explanation:

Heuristic

6 0
3 years ago
How dependent are we on technology? ​
rusak2 [61]

very independent  : ) we use it for everything

3 0
3 years ago
Read 2 more answers
Mention five importance of taskbar​
sveticcg [70]

Answer:

The taskbar is an element of an operating system located at the bottom of the screen. It allows you to locate and launch programs through Start and the Start menu, or view any program that's currently open.

6 0
2 years ago
Michael works for a graphic design firm. He is creating an informative poster. He needs to add a great deal of text in the poste
Dennis_Churaev [7]

Michael will use a Adobe Photoshop or CorelDraw   tool to help format the text for creating an informative poster.

<h3>What application is used for graphic design?</h3>

They are:

  • Adobe Photoshop
  • Illustrator, GIMP
  • CorelDraw
  • Canva  and others

Based on the American Institute of Graphic Arts (AIGA), graphic design is known to be a term that is described as “the art and method of planning and bringing forth ideas and experiences along with the use of visual and textual content.”

Therefore, Michael will use a Adobe Photoshop or CorelDraw   tool to help format the text for creating an informative poster.

Learn more about graphic design from

brainly.com/question/27019704

#SPJ1

3 0
2 years ago
What should you always do to clean off tables
ikadub [295]
Wipe then off then spray them down then wipe off again
7 0
2 years ago
Read 2 more answers
Other questions:
  • An application programming interface (API) is: Group of answer choices the code the application software needs in order to inter
    9·1 answer
  • Interior gateway protocols are used by routers in order to share information within a single
    9·1 answer
  • Which file extension indicates that a file is an Adobe Acrobat document?
    13·1 answer
  • Jennifer recently bought a new computer to type a new manuscript she’s been working on. She also stored a lot of movies on it to
    10·1 answer
  • You want to join your computer to a homegroup but you don't see any homegroups on your home network
    11·1 answer
  • You're working in a table that has three columns and five rows. Since the first row will be a header row, you want it to span al
    6·1 answer
  • How to delete the last element in array
    15·1 answer
  • The working window of a presentation is the O outline O handout 0 notes o slide​
    5·2 answers
  • Write a program to enter RADIUS of a CIRCLE and PRINT AREA of TRIANGLE using Q Basic. (class 8)​
    9·1 answer
  • I recorded a video on my windows PC, but when i tried to play it i got this message:
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!