You need to repeat the code you posted in #11 above for the Commerical.
pseudo code:
if (residential) {
code from post #11
}else if (commerical){
code from post #11 modified for Commerical...
Type: Posts; User: Norm
You need to repeat the code you posted in #11 above for the Commerical.
pseudo code:
if (residential) {
code from post #11
}else if (commerical){
code from post #11 modified for Commerical...
Use an if statement.
If you have two sets of rates then you need logic for each rate. You have posted the logic for the Residential.
Now you need logic for the Commerical.
If the two rate schedules have the same...
Can you copy the relevant parts into your program so it can be seen as part of your posting on this thread?
What does the variable: Service contain?
Define a variable and assign it the value:
final int ResRate = 123.4;
final int ComRate = 234.5;
Then use the variable in the formula to compute the bill.
I don't know how your program determines what the user has chosen.
You will need to get and save that information so you can use it later to determine what equation to use to compute the bill.
Use an if statement with the condition specifying the range of values. Something like:
if(x > 3 && x < 10) { ...
Your chained if /else if statements should also work.
Print out the value of...