You must use Object Oriented Programming toprovide this project.
The project has two classes:
DATA TYPE CLASS
Class SU2022ProductSU_yourLastName
This class holds two arrays:
-one array size 3 that keeps the number of units of 3 productsizes
-one array size 3 that keeps the prices of 3 product sizes
*at index 0 of these arrays will store number of units and unitprice of SMALL size
*at index 1 of these arrays will store number of units and unitprice of MEDIUM size
*at index 2 of these arrays will store number of units and unitprice of LARGE size
The class SU2022ProductSU_yourLastName also has no-argumentconstructor, parameterized constructor, method to generate thecurrent day, method calculates and prints out the sale receipt,method calculates and prints out the day report, method calculateand prints out the compare 2 days report, method toFile to createthe line to write to the output file.
Method generates the current day:
public String getCurrentDate()
{
DateFormat formatter = newSimpleDateFormat("MM/dd/yyyy");
Date date = new Date();
returnformatter.format(date);
}
Method calculates and prints the salereceipt:
-calculate the sale amount of each size:
Money sold small size = array Unit at index 0 * array Price atindex 0
Money sold medium size = array Unit at index 1 * array Price atindex 1
Money sold large size = array Unit at index 2 * array Price atindex 2
-Calculate subtotal = Money sold small size + Money sold mediumsize + Money sold large size
-calculate tax = subtotal * 8.25%
-calculate total = subtotal + tax
-create a String of the output in the following receiptoutput:
File SU2022SaleProductSU_Application_White.java
SU2022 Sale Product SU Receipt – McKINLEY WHITE
Day:06/01/2022 - Transaction #: 0001
-------------------------------------------
SMALL (11.29) 12 135.48
MEDIUM (12.79) 15 191.85
LARGE (13.59) 10 135.90
-------------------------------------------
Subtotal: 463.23
Tax: 38.22
Total: 501.45
Money Paid: 510.00
Change: 8.55
Method toFile() to create one line to write tofile in the following format:
Transaction number numberSmallSize – numberMediumSize –numberLargeSize
0001 12 15 10
Method Print day report
-calculate subtotal, tax, total as in the method printreceipt
-create output String in the following format:
SU2022SaleProductSU_Application_White.java
SALE PRODUCT SU REPORT – McKINLEY WHITE
Day Report: 05/31/2022
-------------------------------------------
SMALL (11.29) 433 4888.57
MEDIUM (12.79) 440 5627.60
LARGE (13.59) 476 6468.84
-------------------------------------------
Subtotal: 16985.01
Tax: 1401.26
Total: 18386.27
Method Compare Two Days
File SU2022SaleProductSU_Application_White.java
SALE PRODUCT SU COMPARE DAYS REPORT – McKINLEY WHITE
COMPARE DAYS: 05/31/2022 and 06/01/2022
--------------------------------------------------------------------------------------------
SALE IN 05/31/2022 SALE IN 06/01/2022 DIFFERENCE PERCENTAGE
SMALL ($11.29) 433 4888.57 492 5554.68 59 13.63%
MEDIUM ($12.79) 440 5627.60 508 6497.32 68 15.45%
LARGE ($13.59) 476 6468.84 478 6496.02 2 0.42%
--------------------------------------------------------------------------------------------
Subtotal: 16985.01 18548.02
Tax: 1401.26 1530.21
Total: 18386.27 20078.23
DRIVER CLASS
Class SU2022SaleProductSU_Application_yourLastName includesfunction main()
A shop sales product SU in 3 sizes: SMALL, MEDIUM, and LARGE inthe following prices:
-size SMALL: $11.29
-size MEDIUM: $12.79
-size LARGE: $13.59
Create a float array size 3 to store 3 above prices, forexample, arrayPrice
First, the application must display the main menu, then read thetask selected from users. After finishing one task, the main menumust be redisplayed to allow users to select other tasks. Theapplication will be terminated if users select 0 from the mainmenu.
File: SU2022SaleProductSU_Application_White.java
PRODUCT SU SHOP MAIN MENU – McKINLEY WHITE
Current Date: 06/02/2022
-----------------------------------------------
1. Sale Product SU
2. Ending Day Sale Report
3. Compare Sale In Two Days Report
0. Exit
Enter a number from 1 to 3 to select a task:
TASK1: SALE PRODUCT SU
When users select 1 to choose the task SALE PRODUCT SU, createan int array size 3 to store the numbers of units that users willbuy, for example, arrayUnit, to store number of units in sizesmall, number of units in size medium and number of units in sizelarge. Then, all numbers of units start at 0.
Display the list of the product size as below to allow users toselect products. After users enter a number of one size, theapplication must redisplay the Product SU menu to allow users toselect other size to order until the users select 0.
When users select a size more than once, for example, usersselect 1 for size SMALL twice with two numbers entered are 8 and 4then the number of units in size SMALL should be 8 + 4 = 12units.
SU2022SaleProductSU_Application_White.java
PRODUCT SU MENU - McKINLEY WHITE
Today: 06/02/2022
-----------------------------
1.SMALL - $11.29
2.MEDIUM - $12.79
3.LARGE - $13.59
0.Exit
Enter a number from 1 to 3 to select product size:
You must use Object Oriented Programming to provide this project. The project has two classes: DATA TYPE CLASS Class SU2
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am