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
Which option is the primary means of communication for coauthors working on PowerPoint presentations?
nasty-shy [4]

Answer:

Comments

Explanation:

The fastest method of communication, and allows everyone that has access to the PowerPoint to see it.

4 0
3 years ago
How do mentors provide professional development opportunities?
Sholpan [36]

The answer is the second one.

Hope this helps! :)

3 0
3 years ago
Read 2 more answers
The length of time that a slide appears in a power point presentation before automatically advancing to the next slide can be se
vivado [14]
The length of time that a slide appears in a power point presentation before automatically advancing to the next slide can be set in the <span> the Transitions tab, then from Timing section, and enable After option and then enter the time interval.</span>
8 0
3 years ago
Write programs that use Least-Squares regression to fit this data with (a) a straight line and (b) a power equation based on log
AfilCa [17]

Answer:In many studies, we measure more than one variable for each individual. For example, we measure precipitation and plant growth, or number of young with nesting habitat, or soil erosion and volume of water. We collect pairs of data and instead of examining each variable separately (univariate data), we want to find ways to describe bivariate data, in which two variables are measured on each subject in our sample. Given such data, we begin by determining if there is a relationship between these two variables. As the values of one variable change, do we see corresponding changes in the other variable?

We can describe the relationship between these two variables graphically and numerically. We begin by considering the concept of correlation.

Correlation is defined as the statistical association between two variables.

A correlation exists between two variables when one of them is related to the other in some way. A scatterplot is the best place to start. A scatterplot (or scatter diagram) is a graph of the paired (x, y) sample data with a horizontal x-axis and a vertical y-axis. Each individual (x, y) pair is plotted as a single point.

Explanation:

6 0
4 years ago
A 500 g stone is thrown up
Alex787 [66]

Explanation:

Assuming no loss in energy when going up or down (i.e.neglect air resistance), the energies are the same at the maximum height as well as the ground.

(II) the initial energy is all kinetic (so is the final energy when it hits the ground), so

KE = (mv^2)/2 = 0.5kg * ( (15^2) m^2/s^2 ) /2 = 56.25 J.

(i) PE at top = KE at bottom = 56.25 J.

4 0
4 years ago
Other questions:
  • Suppose your boss has asked you to write a letter to a client about a problem with their order. What format of writing would you
    9·1 answer
  • You notice that it’s very easy to confuse medications at the community health center where you’re working. They are lined up on
    10·1 answer
  • _____ should be scanned for viruses
    13·2 answers
  • What is the generic term for a mode or method of malware infection?
    8·1 answer
  • Which module is missing from most expert systems? a. Knowledge base subsystem b. Inference engine c. User interface subsystem d.
    5·1 answer
  • A general rule for printing is to use _____ fonts for headlines and serif fonts for body text
    6·1 answer
  • A medium format camera has a large image sensor what benefit will a large sensor have for resulting images. PICK MORE THAN ONE.
    7·1 answer
  • Do you think you should learn to program? Why? why not?
    11·1 answer
  • Virtual classrooms are examples of communication or not​
    5·2 answers
  • What is the easiest way to migrate data from quickbooks desktop to quickbooks online?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!