wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Using several IF-statements to calculate Packages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Using several IF-statements to calculate Packages" Watch "Using several IF-statements to calculate Packages" New topic
Author

Using several IF-statements to calculate Packages

Alejandro Loaiza
Greenhorn

Joined: Sep 13, 2013
Posts: 9
So I'm on my last part of my assignment and I'm stuck on constructing a customers monthly statement if they go over the specific amount of hours they chose from the Packages and it would display the amount of money they would have saved if they chose Package B or Package C. That's only if they go over the hours. In my code, I seem to not be able to use:

if (hours < baseHours) from my internetServiceCharges() so I can calculate. The assignment question is this :

4. Challenge 14: The modifications to your program should be made entirely in main(). You must add statements to perform additional calculations, and extend the customer’s statement with additional information. You must use several if-statements. Test your program all over again to make sure it works as specified. For example:

Total Charges for 50 Package A hours: $89.95
A Package B Customer would have saved $46.0
A Package C Customer would have saved $70.0


I have been working on this for several hours and I broke down. I know the area where I am working at *I am flagging the code!* is off/wrong
because I need several IF's, but where??? I don't understand this at all. Would I be using IF ELSE here because one of my classmates said yes but it's not specified....?

This is my code and I'm extremely sorry if all of this looks like a major mess lol but please help me out with this last bit of code:


Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2174
    
  47
The simple answer is it's hard to do what you want with the way the code is structured. How much of this was given to you by your teacher as a template?

BTW Are you sure you are calculating the customer's total charges correctly?

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using several IF-statements to calculate Packages
 
Similar Threads
completely lost
default case
I am trying to only display at most two decimal digits.(rounding)
Error
Having trouble understanding an error code i keep getting. Please help!