subject

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.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 18:40
How does is make you feel when you're kind to others? what are some opportunities in your life to be more kind to your friends and loved ones? imagine a world where kindness has be outlawed. how would people act differently? would your day-to-day life change significantly? why or why not?
Answers: 2
question
Computers and Technology, 23.06.2019 20:40
Instruction active describing list features which statements accurately describe the features of word that are used to create lists? check all that apply. the tab key can be used to create a sublist. the enter key can be used to add an item to a list. the numbering feature allows for the use of letters in a list. the numbering feature can change the numbers to bullets in a list. the multilevel list feature provides options for different levels in a list.
Answers: 2
question
Computers and Technology, 24.06.2019 00:40
Use a software program or a graphing utility with matrix capabilities to solve the system of linear equations using an inverse matrix. x1 + 2x2 − x3 + 3x4 − x5 = 6 x1 − 3x2 + x3 + 2x4 − x5 = −6 2x1 + x2 + x3 − 3x4 + x5 = 3 x1 − x2 + 2x3 + x4 − x5 = −3 2x1 + x2 − x3 + 2x4 + x5 = 5
Answers: 3
question
Computers and Technology, 24.06.2019 11:20
William travels a lot on business purpose. he needs to regularly communicate with his business partner. he also needs to send out weekly reports to his boss while he is traveling. which web-based application best suits william’s needs? (social media, webmail, wiki) is the best web-based application for william. he can access this application via the internet using a (digital cable, fax machine, web browser).
Answers: 1
You know the right answer?
Create a JAVA PROGRAMCreate a class called PurchaseTotal in the com. day2.practice3 package. That cl...
Questions
question
Computers and Technology, 14.02.2021 06:20
question
Chemistry, 14.02.2021 06:20
question
Social Studies, 14.02.2021 06:20
Questions on the website: 13722367