Ask your own question, for FREE!
Mathematics 7 Online
OpenStudy (zenmo):

Help with output program calculation ( Programming C++)

OpenStudy (zenmo):

OpenStudy (zenmo):

For the first test output, I don't know how to get electricity charges of 154.52

OpenStudy (zenmo):

but, how do I get 154.52?

OpenStudy (dan815):

500 * 154.52/500

OpenStudy (dan815):

154.52/500 is the cost per kwh

OpenStudy (dan815):

Oh nvm I didn't read ur 2nd attachment they tell u how to find cost per kwh

OpenStudy (zenmo):

Yea, I know that. The numbers are there for me to check my program calculations. I just don't know what calculations I have to do in order to get 154.52

OpenStudy (dan815):

The 2nd attachment tells u

OpenStudy (zenmo):

Yea, I multiply 500 to each one, but my numbers aren't correct.

OpenStudy (dan815):

Not like that

OpenStudy (dan815):

So the base line is 75 let's say

OpenStudy (dan815):

U pay a different cost for kwh used more than 75.. then more than 130% of that

OpenStudy (dan815):

And then another for 200% over base line

OpenStudy (dan815):

500 is clearly over 200%of baseline of 75

OpenStudy (dan815):

Okay so u'll pay For the lowest price for the first 75 kwh then 2nd lowest from 76 to 1.30*75 % then 3rd lowest for 1.30*75+1 to 150.. then 151 to500 the highest price

OpenStudy (dan815):

So do cases here. First determine which region your value is in by doing K=Usage /baseline value If k < =1 .... Elseif k <=1.3 .. Elseif k <=2 .. Elsif k>2 ..

OpenStudy (dan815):

Do u get it

OpenStudy (zenmo):

So, I would have to do the full program before getting the value of 154.52 for electricity charges?

OpenStudy (dan815):

U know how the cost is calculated right

OpenStudy (zenmo):

The cost of 154.52? No ... it is still not ringing to me. Could you show it?

OpenStudy (dan815):

I'll give u aneed example Say u pay 0.25 for understanding and equal to 75 kwh Then 0.3 for eveything above 75 to 100 So for 100 You pay 0.25*75 +0.3*(100-75)

OpenStudy (dan815):

I'm on my phone I can't check the prices and all those values you have to post it here

OpenStudy (dan815):

That should say under* and equal 75

OpenStudy (dan815):

U there

OpenStudy (zenmo):

Yea, I am sitting here looking at the instructions

OpenStudy (zenmo):

while reading your messages*

OpenStudy (dan815):

Okay tell me the 4 costs and the base line value post it here

OpenStudy (dan815):

Per kwh

OpenStudy (dan815):

No ur instructions

OpenStudy (dan815):

The 4 costs for under baseline. 130 percent 200 and then over

OpenStudy (zenmo):

$ 0.18151 for each KWH over 0 and less than or equal to BASELINE (const with the value 76.5) $ 0.21546 for eah KWH over BASELINE and less than or equal to 130% of BASELINE. $ 0.27389 for each KWH over 130% of BASELINE and less than or equal 200% of BASELINE. $ 0.34876 for each KWH over 200% BASELINE

OpenStudy (dan815):

Okay so cost for 500 kwh is 0.18151*76.5+0.21546*(1.3*76.5-76.5)+0.27389*(2*76.5-1.3*76.5)+0.34876*(500-2*76.5)

OpenStudy (zenmo):

Yea, I'm figuring out what you did with your equation

OpenStudy (dan815):

Ur paying a different amount for each division Think about the number line

OpenStudy (zenmo):

Your equation is starting to make sense, could you draw a number line for me? My head is like a nut at the moment.

OpenStudy (dan815):

0------75-----97.5-----150-------------500 C1 c2 c3 c4 C1 means cost 1 which is 0.18151

OpenStudy (zenmo):

I am gonna do the 2nd output to check my understanding.

OpenStudy (dan815):

Did u figure out the kwh consumed parr

OpenStudy (zenmo):

it is 500 / 154.52 like you said?

OpenStudy (zenmo):

are you talking about the first one or the 2nd?

OpenStudy (dan815):

2 cases Current meter reading > previous meter reading Current meter reading < previous meter reading

OpenStudy (zenmo):

Yea, I know how to do the programming side. I'm still clueless on how to find the electricity charges before creating the program. I understand your equation on how to get 154.52

OpenStudy (dan815):

That stuff that says adjusting max Meterm stuff for rolling over

OpenStudy (dan815):

Okay now code the eqn

OpenStudy (zenmo):

Okay, I'll try to manage myself from here on. I don't want to hold you here for anymore longer.

OpenStudy (dan815):

Ok I'm going to sleep then cya

OpenStudy (zenmo):

THank you for your patience and helping, including your time :)

OpenStudy (dan815):

Ok before I go so u'll u've ur 4 cases in Let k be the number of kwh consumed If k <=1 .. Elseif k <=1.3 .. Elseif k <=2*76.5 0.18151*76.5+0.21546*(1.3*76.5-76.5)+0.27389*(k*76.5-1.3*76.5) ElseIf k > 2*76.5 0.18151*76.5+0.21546*(1.3*76.5-76.5)+0.27389*(2*76.5-1.3*76.5)+0.34876*(k-2*76.5)

OpenStudy (dan815):

The first 2 cases shud say 1*76.5 And 1.3*76.5

OpenStudy (dan815):

Depending on whice division u are in u can eliminate parts from the equation

OpenStudy (zenmo):

case 1: Else if k <= 76.5 0.18151 * k

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!