Question: The Casual Corner is having a seven-day sale during which the price of any unsold item drops 5 percent each day.
Design a class diagram showing the class, the application program, the relationship between the two, and multiplicity. Then write the Java code as described below. Be sure to follow the CTP 115 Style CriteriaPreview the document for naming conventions, class diagrams, pseudocode, keywords, and operators.
A Sweater class that contains:
an item number and the original price of the item.
Include the following:
A default constructor that initializes each attribute to some reasonable default value for a non-existent inventory item.
Another constructor method that has a parameter for each data member, called the overloaded constructor. This constructor initializes each attribute to the value provided when an object of this type is instantiated. Be sure to incorporate adequate error checking for all numeric attributes.
Accessor and mutator methods for each attribute. Be sure to incorporate adequate error checking for all numeric attributes.
An application program that contains two methods: the main() module and the printSweaterData()module.
The main()module must do the following:
create an Sweater object using the default constructor.
Use a loop to get sweater items from the user. The user should enter the item number and the original price of the item. This loop should continue until the user indicates that they have no more items to enter. For each item entered by the user, the code inside the loop should do the following 2 items:
set the attributes of the Sweater object by calling the appropriate method in the Sweater class for each item entered by the user.
Send the Sweater items, one at a time, to the printSweaterData() module for processing.
The printSweaterData()module must accept a Sweater object and produce a report that shows the item number and the price of an sweater item on each day of the sale, one through seven, using a loop. For example, an item with an original price of $10.00 costs 5 percent less, or $9.50, on the first day of the sale. On the second day of the sale, the same item is 5 percent less than $9.50, or $9.02.
Sample Output MAY look like this:
Sweater Item Number Day Price
12345 1 $10.00
12345 2 $9.50
12345 3 $9.02
and this will continue through day 7. Edit
TutorTeddy.com & Boston Predictive Analytics
[ Email your Statistics or Math problems to firstname.lastname@example.org (camera phone photos are OK) ]
Boston Office (Near MIT/Kendall 'T'):
Cambridge Innovation Center,
One Broadway, 14th Floor,
Cambridge, MA 02142,
Dallas Office (Near Galleria):
15950 Dallas Parkway,
Dallas, TX 75248,