25.00 $

Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: . rar solution files instantly, after Payment


5/5 - (1 vote)

Create a java class Book class as described below: The Book class has three instance variables: The sales tax as a constant The title of the book The price of the book The class has the following methods: Accessor methods (getters) for all instance variables Mutator methods (setters) for the title and price An increasePrice method that accepts one parameter representing the percentage of the increase in price. Note that a 5% increase should be passed in as 0.05. The increasePrice method should adjust the price of the book by the specified percentage. For example, if I have a Book book1 currently priced at $12 and I call the increasePrice method with 5%: book1.increasePrice(0.05); book1 should now be priced at $12.60 A calculateSales method that accepts one parameter representing the number of books sold and computes and returns the total sales. Create test data and calculate the expected result. Input Expected Output Book Number Sold Percent Increase Price Life of Pi – — – Harry Potter – — – Life of Pi – – – Harry Potter – – – Use the Book class you coded above. Sales tax would be 7.5%. Create a Java program class named BookDriver that creates two Book objects. First object is for the book “Life of Pi ” priced at $13.50 and the second is for the book “Harry Potter: Goblet of Fire” priced at $22.00. Sales program should ask the user for number sold for each book and display the resulting sales amount for each, properly labeled and indicating for which book. Then the program will ask the user for percentage increase in price for each book, and update the Book objects accordingly. Display the sales amounts again using the updated prices. All money amounts should be formatted with a dollar sign and two decimal places.

  • Book.rar