Computers and Technology

Create a JAVA PROGRAMCreate a class called PurchaseTotal in the com. day2.practice3 package. That class will have the following class variables: saleId (int), itemName (String), itemPrice (double), itemsSold (int), date (String … store the date in as a String in mm/dd/ format).An example of creating a new PurchaseTotal object: PurchaseTotal total1 = new PurchaseTotal(1, "5-lb bag of apples", 4.00, 25, "10/01/2019");This would be a record stating that the store sold twenty-five 5-lb bags of apples for $4.00 each on October 1st, 2019. Create a class called PurchaseTotalDemo in the com. day2.practice3 package with a main method. In the main, create an array containing 6 PurchaseTotal records. Have three records contain apples sold for 10/01/2019, 10/02/2019, and 10/03/2019. Have the itemsSold contain different values. The other three records will be for a different item sold during those three dates. Create a new method in the PurchaseTotalDemo called calculateInventory which passes in an array of PurchaseTotal records, the name of the item to search for (String), and the initial inventory count (int). The search should not be case-sensitive. The method will return an int of the remaining inventory count for that item. The method will calculate the remaining inventory by adding up all of the items sold for all matching items. This total will be subtracted from the initial inventory, resulting in a number that is the remaining inventory. This count of the remaining inventory will be returned. Example: Let’s say on 10/01/2019, you sold 25 watermelons and on 10/02/2019, you sold 20 and on 10/03/2019, you sold 30 watermelons. If you called the getTotalSales method, passing in the PurchaseTotal array, the String "Watermelon", and an initialInventory of 100, the method will total up all of the watermelons sold (25+20+30 = 75) and then subtract that total from the initial inventory of 100 (100 initial watermelons – 75 watermelons sold = 25 remaining watermelons). So, the method will return how many watermelons remain: 25.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 00:30, hannahrasco4051
Pl i need the answer now ! which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 1
image
Computers and Technology, 23.06.2019 02:30, chaaaa
People with high self-esteem: accept their strengths and weaknesses. believe that failed experiences are failures of their whole self. feel good about who they are only when they reach total success. need positive external experiences to counteract negative feelings that constantly plague them.
Answers: 1
image
Computers and Technology, 23.06.2019 22:00, bb1593
Jackson, who works in the finance department of a company, is holding a seminar for other employees on how to file taxes. only three employees sign up to attend the seminar. which device can he use to share his presentation with a group of three employees?
Answers: 1
image
Computers and Technology, 24.06.2019 08:30, trashellyoung
Why might you choose to create a functional resume
Answers: 1
Do you know the correct answer?
Create a JAVA PROGRAMCreate a class called PurchaseTotal in the com. day2.practice3 package. That cl...

Questions in other subjects:

Konu
Geography, 15.11.2019 06:31
Konu
Mathematics, 15.11.2019 06:31
Konu
Advanced Placement (AP), 15.11.2019 06:31