Question

US government website says the following interesting information: In 2017, the average annual electricity consumption for...

US government website says the following interesting information: In 2017, the average annual electricity consumption for a U.S. residential utility customer was 10,399 kilowatthours (kWh), an average of 867 kWh per month. Louisiana had the highest annual electricity consumption at 14,242 kWh per residential customer, and Hawaii had the lowest at 6,074 kWh per residential customer.

Let us compute the electricity usage and the bill for last month by asking a few questions to a homeowner. Here are the input parameters and output format.

Input: 
# of light bulbs 
Average # of hours each bulb is ON in a day 
AC unit's power 
Typical # of hours AC unit is ON in a day 
# of FANs 
Average # of hours each Fan is ON in a day 
Per-unit price of electricity 

Formatted output: 
Total electricity usage: NNNN kWh 
Bulbs: XX.X% AC: YY.Y% FANs: ZZ.Z% 
Electricity bill for the month: $ NNNN.NN

Here is the sample input:

# of light bulbs: 10

Average # of hours each bulb is ON in a day: 2.4

AC unit's power: 900

Typical # of hours AC unit is ON in a day: 10.5

# of FANs: 4

Average # of hours each Fan is ON in a day: 8.5

Per-unit price of electricity: 9.5

Here is the corresponding output:

Total electricity usage: 368 kWh 
Bulbs: 11.8% AC: 77.1% FANs: 11.1% 
Electricity bill for the month: $ 34.91

Notes:

  • Assume that each bulb consumes 60W and each fan consumes 40W.
  • Assume that the home has only one AC unit and all other appliances including cooking range use other energy sources, NOT electricity. AC unit power is specified in watts.
  • 1 kWh stands for 1000 Watt-hours and it is considered as 1 unit of Electricity and the per-unit price is specified in cents.
  • Assume that the last month had 30 days.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

C++ Program:

#include <iostream>
#include <iomanip>

using namespace std;

int main()
{
int numBulbs, numFans;
double avgBulbON, ACUnitPower, AC_ON_Hrs, avgFanON, perUnitPrice;
double fanC, bulbC, AC_C, totalConsumption=0;
double bill;

//Reading input from user
cout << "\n# of light bulbs: ";
cin >> numBulbs;

cout << "Average # of hours each bulb is ON in a day: ";
cin >> avgBulbON;

cout << "AC unit's power: ";
cin >> ACUnitPower;

cout << "Typical # of hours AC unit is ON in a day: ";
cin >> AC_ON_Hrs;

cout << "# of FANs: ";
cin >> numFans;

cout << "Average # of hours each Fan is ON in a day: ";
cin >> avgFanON;

cout << "Per-unit price of electricity: ";
cin >> perUnitPrice;

//Processing output
bulbC = (numBulbs * avgBulbON * 60 * 30) / 1000;
fanC = (numFans * avgFanON * 40 * 30) / 1000;
AC_C = (900 * 10.5 * 30) / 1000;

//Calculating total consumption
totalConsumption = bulbC + fanC + AC_C;

//Calculating Bill
bill = totalConsumption * (perUnitPrice * 0.01);

cout << fixed << setprecision(0);
cout << "\n\nTotal electricity usage: " << totalConsumption << " kWh";
cout << fixed << setprecision(1);
cout << "\nBulbs: " << ((bulbC/totalConsumption)*100) << "% AC: " << ((AC_C/totalConsumption)*100) << "% FANs: " << ((fanC/totalConsumption)*100) << "% ";
cout << fixed << setprecision(2);
cout << "\nElectricity bill for the month: $ " << bill << "\n\n";

return 0;
}

__________________________________________________________________________________________________

Sample Run:

CATCIUSElectricity bin\Debug\USElectricity.exe of light bulbs: 10 Average of hours each bulb is ON in a day: 2.4 AC units po

Add a comment
Know the answer?
Add Answer to:
US government website says the following interesting information: In 2017, the average annual electricity consumption for...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • (a) If the cost of electricity consumption in Oman is OR 0.030/unit (where, 1 unit =...

    (a) If the cost of electricity consumption in Oman is OR 0.030/unit (where, 1 unit = 1 KWH), Calculate the monthly electricity bill for a load usage of 10 lamps (15 watts each), 10 fans (1000 watts each) and 1 TV (2000 watts) for 18 hrs. a day. [3 marks] (b) Calculate the efficiency of a solar PV module whose length is 259 cm and width is 110 cm and produces a 2560 W maximum power when exposed to 920...

  • Write a python program for the following problem? 100. Cost of Electricity formula The cost of...

    Write a python program for the following problem? 100. Cost of Electricity formula The cost of the electricity used by a device is given by the cost of electricity (in dollars) = wattage of device. hours used 1,000 · cost per kWh (in cents) where kWh is an abbreviation for "kilowatt hour.” The cost per kWh of electricity varies with locality. Suppose the current average cost of electricity for a residential customer in the United States is 11.76¢ per kWh....

  • Need help with this please Lab 14 Electricity Bill Worksheet Background knowledge. The power of an...

    Need help with this please Lab 14 Electricity Bill Worksheet Background knowledge. The power of an electrical appliance is measured in watt (W). One watt is a measure of the energy used up in one second. The unit used for calculating power consumption is the kilowatt-hour (kWh). In order to calculate power consumed by an electrical appliance, we first convert the power to kilowatt (kW). For example, 800 W=0.8 kW, 2000 W = 2.0 kW and so on. One unit...

  • The average US citizen consumes 12000 kWh of electric energy per year an ‘ end use’...

    The average US citizen consumes 12000 kWh of electric energy per year an ‘ end use’ number and does not include the energy lost in converting other energy sources, e.g. fossil fuels to electricity. Note also that a kWh (kilowatt hour) is a unit of energy (not power) but a ‘kWh per year’ is a unit of power. The average electric bill indicates that a consumer pays about $0.12 per kWh of electric energy. Your Uncle Joe wants to get...

  • 25 pts Household Energy Consumption and Electric Bill How Energy Is Used in Homes (2009) In...

    25 pts Household Energy Consumption and Electric Bill How Energy Is Used in Homes (2009) In 2009-2017, the average annual electricity consumption for a U.S. residential utility customer was 10.766 kilowatthours (kWh), an average of 897 kWh per month Req. For the month of June (30 days with 24hr/day) Determine i) the total hours i) Kilowatts/month of June. il) Electric bill based on a charge of $0.085/kwh(-0.079kwh electricity +0.06 transmission). $ iv) Assuming the home has an electric water heater,...

  • Plu-15% oftat "mont Truter, R U, wlho eollected pay the local TDSP You are the enmergy mannger fo...

    Column FHeadings Month Name, kWh/facility, Total kWh for 5 Facilities/Month 4. Using a spreadsheet, figure out how much money the TDSP charge is each month (Jan, Feb, March, etc) for the 5 facilities in total. Column Headings Month Name, Customer Charge, Peak Charge, Energy Charge, Sales Tax, Total (S) 5. Using a spreadsheet, calculate the amount of the energy/generation portion of the bill only (not TDSP charges) for each month of the year (Jan, Feb, March, etc) for the following...

  • (The following information applies to the questions displayed below.) Fields Company has two manufacturing departments, forming...

    (The following information applies to the questions displayed below.) Fields Company has two manufacturing departments, forming and painting. The company uses the weighted-average method of process costing. At the beginning of the month, the forming department has 36,000 units in inventory, 65% complete as to materials and 35% complete as to conversion costs. The beginning inventory cost of $81,100 consisted of $57,400 of direct materials costs and $23,700 of conversion costs. During the month, the forming department started 510,000 units....

  • Hi, Can you please solve these problems. For the information below to answer Questions 1-5. An...

    Hi, Can you please solve these problems. For the information below to answer Questions 1-5. An electronic flashgun has a 2500 μF electrolytic capacitor charged to 300 V and a current-limiting 10 kΩ resistor and. If the lamp resistance is 10 Ω: Question 1 Find the peak charging current [2] 1) 30 A 2) 15 mA 3) 30 mA 4) 20 A Question 2 Find the time required for the capacitor to fully charge (Hint: an electronic flash unit is...

  • Use program control statements in the following exercises: Question 1 . Write pseudocode for the following:...

    Use program control statements in the following exercises: Question 1 . Write pseudocode for the following: • Input a time in seconds. • Convert this time to hours, minutes, and seconds and print the result as shown in the following example: 2 300 seconds converts to 0 hours, 38 minutes, 20 seconds. Question 2. The voting for a company chairperson is recorded by entering the numbers 1 to 5 at the keyboard, depending on which of the five candidates secured...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT