Design a BookOrder class that will ask the user for the subtotal price of their order and how
many books they ordered, and the title of the last book in their order. The program should then
allow them a chance to win a discount (by giving the secret book title), display the amount of
the discount, tax on the order, shipping on the order, and the overall total of the order. The
program should include the following methods:
A method, swap, that accepts a book title and swaps 2 random letters (one for the first
half of the book title, one from the second half of the title). The method should then
display the secret book title, with the letters swapped, to the user.
A method, discount, that generates a random discount between 1 and 15%. The method
should print a message with the amount of the discount and return the amount.
A method, tax, that accepts the subtotal of the order and returns the total tax. Tax is
7.5%
A method, shipping, that accepts the number of books ordered and returns the total
shipping charge. Shipping is $1.75 per book.
A method, total, that accepts the tax, shipping, discount, and subtotal and displays the
total bill.
Round all dollar amount to two decimal places. Make sure to include comments!
Sample Output:
How many books did you purchase?
8
What was the total cost?
13.75
Enter the first word of the title of the last book:
Adventures
The secret book title is: Adrentuves
(swapped positions 2 and 7. This should NOT be printed, just for reference when looking at the
sample output. You DO NOT have to check if the user entered the correct word. We will assume
they entered it correctly after it was shown to them.)
Enter the secret book title to win a discount!
Adrentuves
Congratulations! You're receiving a 9% discount!
The total tax for the order is: $ 1.03
The total shipping for the order is: $ 14.00
The total for this order (including shipping and tax) is: $26.19