Question: 2. Tax calculation Create a Worker class that stores the name and the prices for each of 5 different sold items. Create the Worker objects

2. Tax calculation Create a Worker class that stores the name and the prices for each of 5 different sold items. Create the Worker objects for the following data: Name John Jerry Jamie Prices for each sold items 50 60 70 65 47 53 64 31 22 62 72 40 80 71 42 O Write the following methods : o Default constructor and all-attributes constructor Getters and setters for each class attributes 3 o Calculate the total price for sold items-> return int Calculate the price average of the sold items -> Return float o Calculate total tax that needs to be paid for that worker, including tax, assuming that tax rate is 25% of the price-> Return float o Print the worker name, all prices for each sold item, average of the sold items and total tax for that worker -> Return void O Write a test (main) program that tests all the methods according to the table above
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
