Question

Hi everyone, I have a question which is really hard for me to figure it out...

Hi everyone,

I have a question which is really hard for me to figure it out i have to code this for c++.

-When deciding about whether or not to install solar panels on your house, it becomes useful

to project ahead as to how much you can expect pacific Gas & electric to raise its electric rates each year.

- The lifetime of a solar installation is about 30 years, so you will want to know how much you'll be saving over the next 30 years.

- If we google the PG&E electric rates (A6 schedule) for 2001, we will find that the average cost of a KiloWatt Hour (KWHr), then was 9.92 cents per KWHr.

- If we check for the rate in 2015, we find it is 20.34 cents per KWHr.

-What we want to find out is, over the intervening 14 years, what is the average rate of increase of the cost of a KWHr, per year?

- To project the new years cost per kilowatt (cpk) from the old years rate, we can simply use the formula.

"newYearCPK=(1+averageRateOfIncrease)*oldYearCPK;"

-If we use a loop to do this for 14 years, then we can test out guesses as to what the averageRateOfIncrease (roi) should be. we may be a bit off on the first guess, so we can make a correction and then try again.

-using another loop, gibe yourself the option of continuing on with another try, or quitting, once your satisfied that you are close enough.

- Repeat this procedure until you can determine to 4 digits (that would be 5.2xy% where you need to determine, by trial and error what the values of x and y are) the average rate of increase per year.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

C++ code for the problem is provided below, please comment if any doubts:

C++ code:

#include<iostream>

using namespace std;

//The main function
int main()
{
   //set the local variables
   float averageRateOfIncrease=0.052;
   float firstYCPK=9.92;
   float lastYCPK=20.34;

   //the for loop to trial and error since
   //the value is obaines
   for(;;)
   {
       float oldYearCPK=firstYCPK;
       float newYearCPK=0;
       //iterate 14 years
       for(int i=0; i<14; i++)
       {
           newYearCPK=(1+averageRateOfIncrease)*oldYearCPK;
           oldYearCPK=newYearCPK;

       }

       //If the approximate value reached
       if(abs(newYearCPK-lastYCPK)<=0.001)
           break;

       //else try next trial
       else averageRateOfIncrease=averageRateOfIncrease+0.00001;

   }
   //compute the percentage value
   float inPercent = averageRateOfIncrease*100;
   //Print the result
   printf("The average rate of increase = %.3f ", inPercent);
   return 0;
}

Output screenshot:

Add a comment
Know the answer?
Add Answer to:
Hi everyone, I have a question which is really hard for me to figure it out...
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
  • 4. For an energy source with constant energy production and no operating cost, the levelized cost...

    4. For an energy source with constant energy production and no operating cost, the levelized cost of energy (LCOE) per kilowatt hour (kWh) can be calculated as: annualized capital cost annual kWh production The annualized capital cost is like a mortgage payment, an annual cost that includes paying both the principle and interest (or opportunity cost of capital) over the life of a project. This can be calculated as: Annualized capital cost = K where K is the capital cost,...

  • Hi, i have 2 cases and would be really appreciate if you can help me to...

    Hi, i have 2 cases and would be really appreciate if you can help me to answer it, the first case is already answered and i am wondering is it gonna be same answer with the second case because in first case says Wesfarmers notes that the functional currency and presentation currency of Wesfarmers Ltd and its Australian subsidiaries are the Australian dollar while in the second case it says Wesfarmers lists its overseas subsidiaries and their functional currencies which...

  • The Question IS Which of these projects will actually be invested in? Which of the ones...

    The Question IS Which of these projects will actually be invested in? Which of the ones will people actually do? Investment and real interest rates The article is about how real interest rates drive planned investment. Think about the function investment as a function of real interest rates. Planned investment as a function of real interest rates. Talking about real interest rates, I'm really just talking about nominal interest rates factoring out or discounting what's going on with inflation. There...

  • please show work! ASAP! can you please help me out? I can't figure out. Question 3....

    please show work! ASAP! can you please help me out? I can't figure out. Question 3. Simple Bootstrapping You have fives bonds as shown in the below. Three are zero coupon bonds and the other two are coupon bonds. By applying bootstrapping you would like to compute each spot rate for each bond and figure out the spot rate curve. Bond Coupon Zero Rates Principal 100 100 Maturity 0.25 0.50 1.00 OO 100 1.50 2.00 FERUAWN- Bond Price 97.5 96.9...

  • Here’s another question that I really need help with. Please answer it where I can understand....

    Here’s another question that I really need help with. Please answer it where I can understand. Thank you ! Problem V (15pts) Assume that in a specific project, we tend to study the effect of hydrocarbon consumption, running, walking, biking, gender, and age on weight loss. Discuss about the scientific methods you would use to see the effect of these factors (hint: do you need to find mean, median, variance, etc.? why are they needed? How about IQR? Please include...

  • Please help me. I want to make sure I have them right. Thank you. QUESTION 12...

    Please help me. I want to make sure I have them right. Thank you. QUESTION 12 consider an asset that costs $431,200 and is depreciated straight line to zero over its 10-year tax life. The asset is to be used in a 4-year project; at the end of the project, the asset can be sold for $53,900. Required :If the relevant tax rate is 33 percent, what is the aftertax cash flow from the sale of this asset? (Do not...

  • Please help me figure out question number 7 and 8!!! All answers should have two decimal...

    Please help me figure out question number 7 and 8!!! All answers should have two decimal places and be labelled properly (with $ or %) 2,347,892 View Rates & Availability Review Itinerary Enter Guest Info Confirm Booking 367,495 103,471 72,498 $23,464,220.00 Revenue Room Nights 143,285 1. What is the overall conversion rate? 2. Calculate each micro-conversion rate from one step to the next. View Rates & Availability Review Itinerary Enter Guest Info Confirm Booking 2,347,892 367,495 103,471 % % 72,498...

  • Managerial accounting question. Can someone help me figure this out? Cash Flows Project A Project B...

    Managerial accounting question. Can someone help me figure this out? Cash Flows Project A Project B (10,000) (10,000) 5000 7000 12,000 50,000 These projects are mutually exclusive. 1, 2. What is the payback period for both? If the cutoff is 2 years which one do you accept? a. b. Assume the cash flows 1,2,3 are the same as net income. Assume the asset purchased at time zero depreciates to zero. What is the Average Accounting Return for both? Which one...

  • I have a hard time doing budgets using excel. can someone help me out with questions...

    I have a hard time doing budgets using excel. can someone help me out with questions on this? I did not do well when I submitted it so I am not sure what I did wrong. We were unable to transcribe this image2019SummerFinal Project due 310 - Excel katie, [email protected] - AutoSave a File Home A1 0 X Comments Insert Page Layout Formulas Data Review View Help Search Share x 4 Part 1 M N O 45 Advertising $900 per...

  • can someone assit me with how to get this problem started in excel?? i would like...

    can someone assit me with how to get this problem started in excel?? i would like to figure it out myself. teacher videos are not helping me. 2) (30 points) Suppose you are the physical plant manager for a new hotel with many light fixtures. You need to decide if you should use 15 watt LED bulb or a 70 watt A19 halogen bulbs, each giving equivalent amount of lumens of light. The LED bulb costs $3.37 and the A19...

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