Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your application should use the class you created in the earlier tasks. Your class represents one product that your company sells. Your class should have

Your application should use the class you created in the earlier tasks. Your class represents one product that your company sells. Your class should have at least 3 attributes (instance variables). Getters and setters for each instance variables should be provided. Attributes should be appropriately typed and scoped to incorporate data hiding. Appropriate constructor(s) should be created and called.

The application should provide a user friendly interface that allows the user to input sales data for at least 2 instances of your product class.

Data validation should be incorporated at the time of data entry. At least one error checking condition must be incorporated to allow the user to re-enter a data value that is not valid.

Constructor(s) should be called to create instances of your class once the user has entered valid data.

The interface should allow the display of the entered product information for each product. This information should display well formatted using a combination of printf(), print() and println() statements. Headers and labels should be used in the display to make it clear what each value displayed represents.

After product information has been entered and displayed, your application should allow the user to compute average sales and shipping charges. The application should call the computeAverageSales() and computeShippingCharges() method on your product class.

There is no limit to the number of orders placed for each product. Using sentinel controlled repetition, the computeAverageSales() method should allow a user to enter product sales data until the user has indicated that they are done. The average of the entered sales data will be computed and returned by the method to be displayed by the application. If the value of the average sales exceeds, $200.00, a message should be displayed to alert the user that the product has produced a significant amount of revenue.

The computeShipping Charges() method should use sentinel controlled repetition, to allow a user to enter shipping data until the user has indicated that they are done. The total shipping charges will be computed and returned as a double value. The application will display the computed shipping charges.

Step by Step Solution

3.53 Rating (156 Votes )

There are 3 Steps involved in it

Step: 1

Productjava import javautilArrayList import javautilScanner public class Product private String prod... 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 Systems Introduction to Databases and Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st edition

978-1943153190, 1943153191, 978-0132575676

More Books

Students also viewed these Accounting questions

Question

Create a UML class diagram for the ProductCodes program.

Answered: 1 week ago

Question

Summarize the impact of stress on physical well-being.

Answered: 1 week ago

Question

Create an example of an entity with a derived attribute.

Answered: 1 week ago