Write the code for a method named calculateTax that accepts a double parameter named subTotal and a boolean parameter named isFresno and calculates and returns the sales tax. If isFresno is false, the sales tax should .0775. If it's true, the sales tax should be increased by .001. If the subTotal is less than or equal to zero, an IllegalArgumentException should be thrown with the message "Subtotal must be greater than zero."
So far I believe we need a void statement such as:
void calculateTax(double subtotal, bool isFresno)
but I am not sure where reference and value parameters should be. For instance, I don't know where I should use & to make it a reference parameter. Would the calculate tax be in the main function or the void function?
Feel free to post a code you think would work.
[code]Your code goes here[/code]
Remove the void in the calculateTax that is inside main. The compiler thinks that you want to declare a function inside other function.
When define functions the prototypes must match (you aren't writing the types of the parameters)