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
kkurt [141]
4 years ago
10

An internet service provider has three different subscription packages for its customers.  Package A: For $9.95 per month 10 ho

urs 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. Your task is to write a program that calculates a customer's monthly bill. The program must ask the user which package the customer has purchased and how many hours were used for the current month. It must then display the total amount due. In addition to calculating the monthly bill for the user's current package, your program must do the following: display how much money Package A customers would save if they purchased packages B or C, and how much money Package B customers would save if they purchased Package C. If there would be no savings, no message will be printed for a particular case.
Computers and Technology
1 answer:
tiny-mole [99]4 years ago
4 0

Answer:

C++.

Explanation:

int main() {

   const float package_A = 9.95;

   const float package_B = 14.95;

   const float package_C = 19.95;

   const int package_A_extra = 2;

   const float package_B = 1;

/////////////////////////////////////////////////////////////////////////////

   int user_package_choice;

   int hours_used;

   cout<<"Your package? Enter option number,"<<endl;

   cout<<"1. Package A"<<endl<<"2. Package B"<<"3. Package C";

   cout<<endl;

   cin<<user_package;

   cout<<endl;

   cout<<"Hours used?: ";

   cin<<hours_used;

/////////////////////////////////////////////////////////////////////////////

   cout<<endl;

   float total_amount;

   if (user_package_choice == 1) {

       total_amount = package_A + ((hours_used - 10) * package_A_extra));

       if (total_amount - (package_B + ((hours_used - 20) * package_B_extra)) > 0)

          cout<<"If you had opted for Package B, you would have saved $"<<total_amount - (package_B + (hours_used * package_B_extra))<<endl;

       if (total_amount - package_C > 0)

           cout<<"If you had opted for Package C, you would have saved $"<<total_amount - package_C;

   }

   else if (user_package_choice == 2) {

       total_amount = package_B + ((hours_used - 20) * package_B_extra);

        if (total_amount - package_C > 0)

           cout<<"If you had opted for Package C, you would have saved $"<<total_amount - package_C;

   }

   else {

       total_amount = package_C;

   }

   return 0;

}

You might be interested in
Are lenovo margins expected to be stable in the china operations
lisov135 [29]

Yes

Lenovo Group Limited is the world’s number 3 PC brand. It has gained the operating margins at the perfect levels. Lenovo has attained this steady growth and it expects to maintain or improve its gross margin in China operations now and in the future.

3 0
4 years ago
Read 2 more answers
You use buttons and commands on the ribbon to tell word what you want to do. true or false
GarryVolchara [31]
Yes, that is true. The buttons and commands are used for their specific actions on the computer.
7 0
4 years ago
g Write a program that allows a user to input any text in your program. Using the tools that we have discussed, your program sho
Paladinen [302]

Answer:

Explanation:

The following function/program is written in Java. It asks the user for a sentence as an input and then splits that sentence into an array of words. Then it creates an arrayList for all of the unique words, comparing each word in the sentence with all of those in the ArrayList. If a word is found in the ArrayList it cancels the loop and moves on the next word in the sentence. Finally, it counts all of the unique words in the ArrayList and prints that total to the screen.

public static void uniqueWords() {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter a sentence:");

       String sentence = in.nextLine();

       String words[] = sentence.split(" ");

       ArrayList<String> uniqueWords = new ArrayList<>();

       for (int x = 0; x < words.length; x++) {

           boolean exists = false;

           for (int i = 0; i < uniqueWords.size(); i++) {

               if (words[x].equals(uniqueWords.get(i))) {

                   exists = true;

                   break;

               }

           }

           if (exists == false) {

               uniqueWords.add(words[x]);

           }

       }

       System.out.println(uniqueWords.size());

   }

5 0
3 years ago
In cryptocurrency, a block is only considered valid if it has a.
melomori [17]

Answer: Token

Explanation: The token gives proof that it is yours.

3 0
3 years ago
Create your code from the story using code blocks.You must include at least one of each of the following blocks. You can draw or
Mazyrski [523]

Answer:

Como puedo hacerlo.

Explanation:

Me enseñas como hacerlo

6 0
3 years ago
Read 2 more answers
Other questions:
  • A​ client-server application that requires nothing more than a browser is called​ ________.
    8·2 answers
  • The human resource (HR) manager stores a spreadsheet with sensitive personal information on her local workstation. The spreadshe
    11·1 answer
  • Assume you're running a query on your orders in the past year. You want to see how many orders were placed after May. What type
    5·1 answer
  • __________ contain(s) remnants of word processing documents, e-mails, Internet browsing activity, database entries, and almost a
    9·1 answer
  • The mouse pointer becomes different shapes depending on the pointer s location and locations you click on the screen. true false
    6·1 answer
  • X333: countElements Given an array of integers and an integer target, return a count of the number of times the target value occ
    6·1 answer
  • If you have an ordered list of all the states in North America, and you want to add a title "States of North America", what tag
    14·1 answer
  • Select the correct answer from each drop-down menu.
    5·2 answers
  • Write a program code which asks for 80 numbers between 100 and 1000 to be entered.
    12·1 answer
  • One subtask in the game is to ‘refuel a car’. Explain why ‘refuel a car’ is an abstraction.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!