Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA NETBEANS IDE (50 points) Sales Tax: Write a class SalesTax that will calculate the sales tax on a purchase. (This should be similar to

JAVA NETBEANS IDE (50 points) Sales Tax: Write a class SalesTax that will calculate the sales tax on a purchase. (This should be similar to the BankAccount class on pages 96 and 97). There should be a constructor that accepts as input the state sales tax rate and the county sales tax rate. These will be two different inputs (2 parameters). (6 points) Write a method that calculates the sales tax. This method should accept as input the price of the purchase (this will be used later so it needs to be assigned to a variable belonging to the class an instance variable) and calculate the total sales tax charged on the purchase. (7 points) There should be another method that calculates the total cost by adding the initial purchase (variable you received in previous method) and the sales tax. (7 points) There should be a method to return sales tax. (5 points) There should be a method to return the total cost. (5 points) Write a tester class that asks the user to input the purchase price. The tester class should use a state sales tax rate of 6 percent and a local sales tax rate of 4 percent. (These are input to the SalesTax class). (20 points) Create an object using the sales taxes given. Execute the method to calculate the total sales tax using the input. Execute a method to calculate the total product cost. Print the original price, the total sales tax, and the total cost of the product. Also print the expected total sales tax and the expected total cost of the product.

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

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

0805302441, 978-0805302448

More Books

Students also viewed these Databases questions

Question

Can workers be trained in ethics? How? Defend your answer.

Answered: 1 week ago