Question

In: Computer Science

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.

Help!

Solutions

Expert Solution

Code

#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 fanPer,bulbPer,ACPer;
   double totalPrice;

   cout<<"# 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;

   fanC=avgFanON*numFans*40;
   bulbC=avgBulbON*numBulbs*60;
   AC_C=AC_ON_Hrs*ACUnitPower;

   totalConsumption=fanC+bulbC+AC_C;

   fanPer=100*fanC/totalConsumption;
   bulbPer=100*bulbC/totalConsumption;
   ACPer=100*AC_C/totalConsumption;

   totalConsumption=ceil((totalConsumption*30)/1000);

   totalPrice=totalConsumption*perUnitPrice;

   cout<<"\nTotal Total electricity usage: "<<totalConsumption<<" kWh"<<endl;
   cout<<fixed<<setprecision(1);
   cout<<"Bulbs: "<<bulbPer<<"% AC: "<<ACPer<<"% FANs: "<<fanPer<<"%\n";
   cout<<fixed<<setprecision(2);
   cout<<"Electricity bill for the month: $"<<totalPrice/100<<endl;
   return 1;
}

output

If you have any query regarding the code please ask me in the comment i am here for help you. Please do not direct thumbs down just ask if you have any query. And if you like my work then please appreciates with up vote. Thank You.


Related Solutions

Refer to the 2017 annual report of Woolworth on its website, and answer the following questions...
Refer to the 2017 annual report of Woolworth on its website, and answer the following questions using the consolidated income statement and balance sheet/ statement of financial position and notes to the consolidated financial statements. The Woolworth income statement shows a deduction (in brackets) for income tax expense. Would this expense item be seen in the income statement of a partnership? Explain your answer. In the statement of changes in equity regarding retained earnings, how is the total profit avail­able...
Refer to the 2017 annual report of Woolworth on its website, and answer the following questions...
Refer to the 2017 annual report of Woolworth on its website, and answer the following questions using the consolidated income statement and balance sheet/ statement of financial position and notes to the consolidated financial statements 1.Refer to the balance sheet (statement of financial position) of Woolworth and the note titled ‘issued capital’. How do these differ from that of a typical partnership? Explain. 2.Woolworth is required to produce a statement of cash flows (cash flow statement) and include this in...
An investor has $1,000,000 invested in US government bond with an average annual return of 3%....
An investor has $1,000,000 invested in US government bond with an average annual return of 3%. The investor decides to invest 60% of her money on a tech stock that has an average annual return of 8%. The variance of the tech stock is estimated to be .002025. a. What is the variance of the portfolio created by combining government bond and the tech stock? [                  ] b. What is the expected return to investor’s portfolio? [                ] c. Find...
Currently, around 17% of US electricity comes from renewables. The US government begins requiring that 30%...
Currently, around 17% of US electricity comes from renewables. The US government begins requiring that 30% of electricity come from renewables. a) Draw a graph of the electric car market that clearly labels supply and demand and shows how they shift. How do the equilibrium price and quantity change? b) Draw a graph of the oil market that clearly labels supply and demand and shows how they shift. How do the equilibrium price and quantity change?
An electricity company charges electricity consumption according to the following scale. Up to 200 Units (0-200)...
An electricity company charges electricity consumption according to the following scale. Up to 200 Units (0-200) to 0.25 € per unit The next 1000 Units (201-1200) to 0.40 € per unit Over 1200 units to 0.50 € per unit. Write a program in python language that accepts the number of units consumed by the customer and displays the amount of money owed by the customer to the electricity company
Land footprint of solar energy: (a) In 2016, Arizona’s total annual electricity consumption was 78.05 million...
Land footprint of solar energy: (a) In 2016, Arizona’s total annual electricity consumption was 78.05 million MWh. What is this in terms of kWh per day? (b) Land footprint: The average daily insolation in Phoenix is 5.38 kWh/m2/day. Given this daily energy input, how much land area would you need (in square miles) to generate all of Arizona’s daily electricity from the following types of PV panels: i. Mono-crystalline Si panels with an efficiency of 22 %? ii. Thin film...
Questions 2 and 3 refer to the following information regarding the annual consumption of coffee of...
Questions 2 and 3 refer to the following information regarding the annual consumption of coffee of the 41 males. Of the sample of the 41 males, the sample mean is 25.7 gallons and the sample standard deviation is 3.8 gallons. Assume the data is normally distributed and the sample is randomly selected. 2. Assuming α = 0.005, is there enough evidence to support a claim that the mean amount of consumption is at least 28 gallons? (12 points) 3. Assuming...
Energy consumption. The following table presents the average annual energy expenditures (in dollars) for housing units...
Energy consumption. The following table presents the average annual energy expenditures (in dollars) for housing units of various sizes (in square feet). Size 250 750 1250 1750 2250 2750 3250 3750 Energy    Expenditure 1087 1228 1583 1798 1939 2138 2172 2315 c.) If two homes differ in size by 250 square feet, by how much would you predict their energy expenditure to differ? d.) Predict the energy expenditure for a home that is 2000 square feet. e.) Compute the...
The annual electricity production/consumption for the GRU (Gainesville Regional Utility) territory is about 1.9 million MWh/yr....
The annual electricity production/consumption for the GRU (Gainesville Regional Utility) territory is about 1.9 million MWh/yr. Let’s assume that we can implement a significant energy efficiency program that can decrease the electricity consumption by 20%. It is also known that GRU has a 102.5 MW biomass power plant. With these facts and assumptions and your knowledge of solar energy, what size of PV array (in MW’s) needs to be installed for GRU to be 100% renewable powered for its annual...
Q1.(10 pts) The fridge manufacturer claims the average daily electricity consumption of one energy efficient model...
Q1.(10 pts) The fridge manufacturer claims the average daily electricity consumption of one energy efficient model is 0.5 kW.h, the standard deviation of the daily electricity consumption is 0.16 kW.h. For one random sample of 45 fridges, Find the probability that the sample average daily electricity consumption is greater than 0.55 kW.h. Q2.(10 pts) Following the above Q1, 1.(5 pts) Given a random sample 45 fridges of this model, the average daily electricity consumption of this sample is 0.52 kW.h,...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT