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 a “spoof” of an ad ?
kykrilka [37]
I think a spoof of an ad is the study of an ads rhetorical devices that is what I think I am not completely sure
5 0
2 years ago
Read 2 more answers
The best technique to read​
Readme [11.4K]

Answer:

The best reading techniques are the SQ3R technique, skimming, scanning, active reading, detailed reading, and structure-proposition-evaluation.

Explanation:

6 0
3 years ago
List any 5 Unix commands with their brief description?
AlexFokin [52]

Answer:

Commands: commands are also known as "programs" and the program is a set of rules that performs a specific task which is executed by a computer.

Unix is an operating system. that supports multi-tasking and multi-user functionality. Unix is most widely used in all forms of computing systems such as desktop, laptop, and servers. It provides a Graphical user interface similar to windows.

The Unix operating system there are various commands. The list of five Unix commands can be given as:

1) cal

2) date

3) banner

4) who

5) whoami

1)cal:

The cal command stands for calender. It displays the date.

Syntax:

$ cal

or

$ cal [[month] year]

Example:

$ cal 10 2019

2)date:

The date command stands for date and time. It displays the system date and time.

Syntax:

$date

or

$ date[+format]

Example:

$ date +%d/%m/%y

3) banner

The banner command stands for display the text in to a large size.

Syntax:

$banner message

Example:

$banner Unix

4) who

The who command stands for display the list of users currently logged in.

Syntax:

$who

or

$who [option] … [file][arg1]

Example:

$who

5) whoami

The whoami command stands for display the user id of the currently logged-in user.

Syntax:

$whoami

Example:

$whoami

Explanation:

1)cal command display the current month and year.

2)date command display system date and time.

3)banner command display text in large size.

4)who command display the user name who currently login.

5)whoami command display user id.

4 0
3 years ago
A restaurant chain has several store locations in a city (with a name and zip code stored for each), and each is managed by one
bazaltina [42]

Answer:

The restaurant chain system consist of restaurant id, name, zipcode, manager id, menu list.

Manager; manager id, name, phone no, and store.

Menu; menu id, type, items and description.

Items; item id, price and description.

Explanation:

Please look at the attachment for the E. R diagram.

5 0
3 years ago
What is the difference between the animation with shape hints and the animation without the shape hints?
soldier1979 [14.2K]
Animation with shape is 3D animation
Animation without shape is 2D animation
4 0
3 years ago
Other questions:
  • Which of the following statements is true?
    6·1 answer
  • 20 Points!! Please hurry!!
    9·1 answer
  • What would happen if you clicked on the Show Desktop icon on your computer screen? The system tray would appear. All open window
    9·2 answers
  • What is the function of the capsid? it allows a virus to live independently. it is composed of genetic material. it destroys the
    12·2 answers
  • Which one of the following statements is correct? a. Web browsers cannot function without cookies. b. Cookies are text files and
    9·1 answer
  • Create a 4x5 matrix with ones everywhere and zeros on the last row.
    14·1 answer
  • 17.
    15·1 answer
  • Question 5 of 25
    10·2 answers
  • Explain the evolution of programming language​
    15·1 answer
  • Explain the term software dependability. Give at least two real-world examples which further elaborates
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!