Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started