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
arlik [135]
3 years ago
7

The electric company gives a discount on electricity based upon usage. The normal rate is $.60 per Kilowatt Hour (KWH). If the n

umber of KWH is above 1,000, then the rate is $.45 per KWH. Write a program (L4_Ex1.cpp) that prompts the user for the number of Kilowatt Hours used and then calculates and prints the total electric bill. Please put comment lines, same as in Lab3, at the beginning of your program. According to your program in Lab 4.1, how much will it cost for: 900 KWH? 1,754 KWH? 10,000 KWH?
Computers and Technology
1 answer:
katrin2010 [14]3 years ago
3 0

Answer:

The cpp program for the given scenario is shown below.

#include <stdio.h>

#include <iostream>

using namespace std;

int main()

{

   //variables to hold both the given values

   double normal_rate = 0.60;

   double rate_1000 = 0.45;

   //variable to to hold user input

   double kwh;

   //variable to hold computed value

   double bill;

   std::cout << "Enter the number of kilowatt hours used: ";

   cin>>kwh;

   std::cout<<std::endl<<"===== ELECTRIC BILL ====="<< std::endl;

   //bill computed and displayed to the user

   if(kwh<1000)

   {

       bill = kwh*normal_rate;

       std::cout<< "Total kilowatt hours used: "<<kwh<< std::endl;

       std::cout<< "Rate for the given usage: $"<<normal_rate<< std::endl;

       std::cout<< "Total bill: $" <<bill<< std::endl;

   }

   else  

   {

       bill = kwh*rate_1000;

       std::cout<< "Total kilowatt hours used: "<<kwh<< std::endl;

       std::cout<< "Rate for the given usage: $"<<rate_1000<< std::endl;

       std::cout<< "Total bill: $" <<bill<< std::endl;

   }

   std::cout<<std::endl<< "===== BILL FOR GIVEN VALUES ====="<< std::endl;

   //computing bill for given values of kilowatt hours

   double bill_900 = 900*normal_rate;

   std::cout << "Total bill for 900 kilowatt hours: $"<< bill_900<< std::endl;

   double bill_1754 = 1754*rate_1000;

   std::cout << "Total bill for 1754 kilowatt hours: $"<< bill_1754<< std::endl;

   double bill_10000 = 10000*rate_1000;

   std::cout << "Total bill for 10000 kilowatt hours: $"<< bill_10000<< std::endl;

   return 0;

}

OUTPUT

Enter the number of kilowatt hours used: 555

===== ELECTRIC BILL =====

Total kilowatt hours used: 555

Rate for the given usage: $0.6

Total bill: $333

===== BILL FOR GIVEN VALUES =====

Total bill for 900 kilowatt hours: $540

Total bill for 1754 kilowatt hours: $789.3

Total bill for 10000 kilowatt hours: $4500

Explanation:

1. The program takes input from the user for kilowatt hours used.

2. The bill is computed based on the user input.

3. The bill is displayed with three components, kilowatt hours used, rate and the total bill.

4. The bill for the three given values of kilowatt hours is computed and displayed.

You might be interested in
Which of the following rules should be used to keep the appropriate distance between your vehicle and the vehicle in front of yo
S_A_V [24]
I would say two car length rule. I am not sure what the official license rule is or if it has been changed, but originally the rule was 3 seconds usually depending on how fast the car is going. The faster you are going, the longer it takes to stop. So two-car length rule would probably be the best choice. Definitely not A.
8 0
3 years ago
Read 2 more answers
You want to decide whether you should drive your car to work or take the train. You know the one-way distance from your home to
tester [92]

<u>Explanation:</u>

Remember, an algorithm in simple words means a set of instructions or steps to be followed in other to solve a problem.

Note, to decide which commute is cheaper, it means the output of the algorithm should be the cheaper way to commute.

Using pseudocode do the following;

  • determine the inputs and outputs of the problem
  • arrange the identified problem into micro-tasks
  • describe each micro-tasks in the pseudocode
  • Test the pseudocode by solving the problem.

                       

3 0
3 years ago
On laptops, wireless cards tend to be attached to which panel?
Arada [10]

Answer:

NONE of the above   to fix  wireless  cards to be attached to any panel

Explanation:

Basically, the WiFi receiver and transmitter are fixed in the mother of the laptop and fixed. In case if we   open the laptop if PCI slot is   available   and suitable WiFi card and able fit it  to size then   end user he or she  can fixed and  try

The hard drive is the backside of the laptop. If e place the WiFi system will able to boot.

LCD panel it is just displayed out the unit and  its  fixed in a different  place and connected to led or LCD panel

Palm rest it places where there is no slot available  

Ram panel if we fix WiFi card then the laptop will not start.

Better by USB dongle and use it.

5 0
3 years ago
what is the difference between the registry and server manager in reference to its management/configuration ?
Ksivusya [100]

Explanation:

Server manager perform various types management tasks in Microsoft window to manage remote severs without require any physical access. It enable remote desktop connection protocols. It basically use server manager for manage the server remotely.

Registry is very important as it store essential information about the window system and about its configurations. It is mainly use in Microsoft window for operating its system and applications. It also store low level settings in the system.

6 0
2 years ago
Which Display Ad format should you use if you're concerned about malware and want a secure ad experience across platforms?
Dennis_Churaev [7]

Answer:

"AMPHTML ads" is the correct answer for the above question.

Explanation:

  • The "AMPHTML" is used for secure ads, which is written in the form of AMP HTML.
  • It is a lighter and faster ad that has the features of doing the ads securely.
  • It is safe from the virus because it is verified by the software while transferring on the internet.
  • The above question asked about the display which can be used for secure ads. Then the ads are an "AMPHTML" which is described above.
3 0
3 years ago
Other questions:
  • 850 cal into joules​
    13·1 answer
  • __ is/are the amount of blank space between lines of text in a paragraph
    7·2 answers
  • A personal business letter is a letter that is ____.
    13·1 answer
  • The function below takes a string argument sentence. Complete the function to return the second word of the sentence. You can as
    5·1 answer
  • Next, go to the mw_tour.html file. Within the document head, create links to the mw_layout.css and mw_styles.css style sheet fil
    10·1 answer
  • If you do not use the mini toolbar, it remains on the screen. _______________​ Group of answer choices True False
    8·1 answer
  • Which of the following access control techniques allows the user to feel empowered and able to change security attributes?
    5·1 answer
  • Chegg Suppose the heap is a full tree, size 2^n-1. what is the minimum number of steps to change a min heap to a max heap. Show
    5·1 answer
  • Bro i swear whenever i play fortnite duos, they ask you if you don't have a mic, if you don't then they just leave, so annoying
    15·2 answers
  • Please tell fast plzzzzzzzzzzz.​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!