Question about Microsoft Educational & Reference Software
Please try to solve it quickly
It sounds like a homework assignment that you are supposed to write. Get a copy of your electric bill and look at all the various charges, fees, taxes, etc. Then write the program.
Posted on Mar 13, 2009
Well here is an idea.
Take the total kilowattage and send it toa function. What the function will do is subtract 14KW from the totalKilowattage and add the amount for the first 14KW then subtract 85KWfrom the total KW and add the amount for the 85KW. But once yousubtract the number of KW from the total make sure to check if thetotal KW isn't negative, if so just break out of the function andreturn the total due.
Or if you have formula for how much the rate grows over how many miles.
For example lets say the rate grows by $1 every time the KW doubles you could have something like
int rate = 1; //Begining rate
int KW = 14; //First flat rate
int amount; //total amount they have to pay
while(totalKW > 0)
{
totalKW -= KW; //subtract the first rate
if(totalKW <= 0) //check if too much subtracted
break; //if so break
amount += rate; //add the rate to the total
rate += 1; // Add $1 to the rate every time
KW *= 2; // KW is doubled
}
P.S.: If this information was helpful, please rate this solution.
×
Nov 09, 2014 | Educational & Reference Software
Jul 17, 2014 | SoftMath Algebrator - Algebra Homework...
Feb 08, 2011 | Educational & Reference Software
Jan 30, 2011 | Super Tutor Trigonometry (ESDTRIG) for PC
Jan 12, 2011 | Microsoft Educational & Reference Software
Dec 27, 2009 | ValuSoft Are You Smarter Than A 5th...
Jul 04, 2009 | Educational & Reference Software
Jun 25, 2009 | Ubi Soft Catz 5 (Windows) (680901) for PC
Sep 10, 2008 | Educational & Reference Software
Mar 09, 2008 | Parsons QuickVerse 7 Essentials (fe11044)...
Mar 04, 2016 | Microsoft Windows Server 2008 R2 Standard...
Jan 04, 2014 | Microsoft Office for Mac Home and Student...
Mar 23, 2013 | Microsoft AutoRoute
517 people viewed this question
Usually answered in minutes!
×