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
A network administrator identifies sensitive files being transferred from a workstation in the LAN to an unauthorized outside IP
Sav [38]

Answer:

D. Zero-day

Explanation:

It is clearly stated that the antivirus is still up-to-date on the workstation, and there has been no alterations to the firewall. Hence, this means the software is functional and up-to-date with all known viruses. This shows that this attack is unknown to the manufacturer of the antivirus software and hence no virus definition or patch fixing this problem has been developed yet. In this light, it is a zero-day.

A zero-day is a type of vulnerability in a software that is not yet known to the vendor or manufacturer, hence this security hole makes the software vulnerable to attackers or hacker before it is been fixed.

4 0
3 years ago
What type of document is a mobile device's EULA?
MakcuM [25]
EULA stands for End User License Agreement. This document is the contract between the software application author or publisher and the user of that application. It is also called "software license", because it establishes the purchaser's right to use the software on the mobile device. T<span>he user agrees to pay for the privilege of using the software, and promises the software author or publisher to comply with all restrictions stated in the EULA. </span>
6 0
3 years ago
The fastest way to get help is to type a word or two in the search box.
Elanso [62]
The fastest way to get help is to type a word or two in the search box. TRUE.
5 0
3 years ago
¿Por qué es importante aprender a programar?
White raven [17]

Answer:

Es importante aprender a programar, por que es el mismo de que alguen aregle su carro. En estos tiempos, la technolagia se ha convertido en la nueva normal. Va vinir el tiempo quando nosotros necesitamos que arreglar un linia de codigo en nuestras computadoras, y no esta necesario para pagar alguen que ellos lo agan. Como quando necesitas que poner una llanta nueva a tu carro. Tu lo puedes cambiar solo. Entonses como el ejemplo del carro, tu puedes arreglar el linia de codigo en la computadora sin pagar alguen por acerlo.

7 0
2 years ago
6.10.1: Modify a C string parameter. Complete the function to replace any period by an exclamation point. Ex: "Hello. I'm Miley.
Andrej [43]

Answer:

#include <iostream>

#include <cstring>

using namespace std;

void replacePeriod(char* phrase) {

int i = 0;

while(*(phrase + i) != '\0')

{

if(*(phrase + i) == '.')

*(phrase + i) = '!';

i++;

}

}

int main() {

const int STRING_SIZE = 50;

char sentence[STRING_SIZE];

strcpy(sentence, "Hello. I'm Miley. Nice to meet you.");

replacePeriod(sentence);

cout << "Updated sentence: " << endl;

cout << sentence << endl;

return 0;

}

Explanation:

  • Create a function called replacePeriod that takes a pointer of type char as a parameter.
  • Loop through the end of phrase, check if phrase has a period and then replace it with a sign of exclamation.
  • Inside the main function, define the sentence and pass it as an argument to the replacePeriod function.
  • Finally display the updated sentence.
6 0
3 years ago
Other questions:
  • 1. Which of the following options will allow you to insert a quick table? (1 point) Insert ribbon &gt; Shapes drop-down menu
    6·2 answers
  • In the MOV instruction both operands i.e. source andthe destination cannot be
    15·2 answers
  • A database has a built-in capability to create, process and administer itself.
    14·1 answer
  • The partners of a small architectural firm are constantly busy with evolving client requirements. To meet the needs of their cli
    11·1 answer
  • You work as an IT Technician for uCertify Inc. David, a user, has recently purchased a laptop computer. He is now complaining th
    14·1 answer
  • Which shortcut key aligns text to the center of the paige
    5·1 answer
  • Why should you avoid the use of sarcasm, clichés, and idioms in business letters?
    11·2 answers
  • ...................is a high level, structured , open source programming language​
    10·1 answer
  • Write down the characterizations that best suits the term Java applets?
    7·1 answer
  • Does anyone know this? Can someone please help me? I’ll give brainliest!!
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!