Question: Language = JAVA Create a method that accepts the number of books purchased and the subtotal. Have the method do your math and return a

Language = JAVA

Create a method that accepts the number of books purchased and the subtotal. Have the method do your math and return a double as the order total, using the rules for shipping & tax.

You may name your method whatever you want. Use good naming conventions and a logical name to indicates what the method does.

You can name your method whatever you want. Now, you'll be working with two methods. In your main method, the following should occur:

  • prompt the user for the number of books
  • prompt the user for a book subtotal
  • pass those numbers as parameters to your method
  • receive a double back from your method and print it out to the console for the user with the DecimalFormat class or printf( )

In your method:

  • do the math to figure out the tax & shipping costs.
  • add everything up
  • return a double that represents the final order total.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!