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
They are correct? thank you!
SashulF [63]

Answer:

YES IT IS RIGHT ANSWER

Explanation:

WELCOME :)

3 0
3 years ago
Read 2 more answers
What are some of the ways we can resolve IPv4 address shortages? Check all that apply.
AURORKA [14]

Answer:

I am not as close to the network as I used to be but I have not seen articles about the network apocalypse due to IPv4 address depletion. Unlike in the late 90’s when predictions of apocalypse were everywhere.

What happened?

Two things:

Network address translation (NAT) was introduced to allow organizations to use private addresses on their internal network and minimize the requirement for “real” IP4 addresses.

Second, IPv6 was created and introduced to expand the number of addresses available.

So, a direct answer is use IPv6 and/or NAT for internal networks.

Explanation:

8 0
3 years ago
As it relates to confidentiality, data may be classified in three ways. Match each data classification below to its definition.
Delicious77 [7]

Answer:

 According to the confidentiality, the data are classified into the three ways that is confidential, public and controlled and it the data classification are matched according to to its particular definition are as follows:

Confidential  = (C) Cannot be released without owner's consent.

Public = (A) Accessible to everyone

Controlled = (B) Not public but can be released without owner's consent

 The confidentiality of the data is basically known as protecting the data from the unauthorized and unlawful access. The data confidentiality is the set of the rules which limit the unauthorized access to the confidential information and it is only available to the authorized people with the reliable access to the data.

5 0
3 years ago
Https://www.blooket.com/play?id=300932<br> please
padilas [110]

Answer:

Okay, I will play with you

3 0
3 years ago
Read 2 more answers
Read first a user's given name followed by the user's age from standard input. Then use an ofstream object named outdata to writ
Stells [14]

Answer:

/*

* Program to write data to text file.

*/

#include<iostream>

#include<fstream>

#include<string.h>

using  namespace std;

int main()

{

//Variable to name and age of a person.

string name;

int age;

cout<<"Enter your name"<<endl;

cin>>name;

cout<<"Enter your age"<<endl;

cin>>age;

     //Creating object of ofstream.

   ofstream file;

   file.open ("outdata.txt");

   //Writing data to file named outdata.txt

   file<<name<<" "<<age;

   file.close();

 

}

Output:

Enter your name

John

Enter your age

25

Content of Output.txt:

John 25

Explanation:

To write data to a file  ofstream object is used. An ofstream object file is created first and then using this object a file named "outdata.txt" is created.

Finally using shift operator (<<), by means  of operator overloading, name and age of  person is transferred to file outdata.txt.

8 0
3 years ago
Other questions:
  • I will mark brainalist! ​
    5·1 answer
  • Encyclopedia.com is considered to be
    15·1 answer
  • Assume you have a int variable n that has already been declared and initialized. Its value is the number of integers that need t
    13·1 answer
  • How do you change the text style on brainly mobile ?
    12·1 answer
  • __________ is a protocol used by e-mail clients to download e-mails to your computer.
    14·1 answer
  • which telecommunications service allows internet and telephone service to work over the same phone line
    13·1 answer
  • Which of the following attacks seeks to introduce erroneous or malicious entries into a server's hostname-to-IP address cache or
    5·1 answer
  • Our readings so far explored computer hardware and software, in particular operating systems and application software. There are
    11·1 answer
  • You have just connected a new computer to your network. The network user static IP addressing. You find that the computer can co
    12·2 answers
  • Microsoft Windows is the least used operating system. TRUE or FALSE.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!