Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions

Question

8. Set goals that relate to practice as well as competition.

Answered: 1 week ago

Question

Design a health and safety policy.

Answered: 1 week ago