subject

Write the Java code to simulate an inventory control system and a point of sale system with customer history On program start, each inventory item's data is read from the inventory file, placed in a new item class object, which is then placed in the inventory ArrayList. The ArrayList should be a field in the purchasing class (see below). The inventory data consists of the following fields. Only the last three data fields (ns listed here) should be modifiable after the object is created. A constructor will accept parameters for each of the fields, (a) The item's name (b) The item's. com (c) The current quantity of the item on-hand (d) The number of times the item has been purchased (e) The number of times the item hus been returned. After the inventory is processed, each existing customer's data is read from the customer file, pleced in a new item class object, which is then placed into the customer ArrayLut The ArrayList should be a local variable in the main method. The customer data consists of the following fields. All data in the customer clues should be modifiable based on the details given later. A constructor will accept parameters for each of the field (1) The customer's name (b) The customer's balance (positive balance indicates the customer has funda avul able to spend, and negative balance indicates the customer cwmoney) c) The customer's purchase history populated by a list of inventory item references from the inventory ArrayList. The history is stored in the customer file as a lint of inventory name along with the number of purchased items (d) The customer's shopping cart initially empty and not stored in the customer file. but alno populated by a list of inventory item references A purchasing class object contain the following methods for manipulating the ventory Armalist and a pied customer object. Each method will update the listed properti. A defnult constructor will create an instance of the inventory ArrayList and the value for a restocking for () Add an item to shopping cart (Inventory quantity customer shopping out) The castomer is pated with a lot of available items and more on selection. The men of ieme shown to the wet in generated from the ArrayList of kventory Item W Anong there is a lot one of item oond the item selected to "I decreased in the story Art The cutomer intend chose to not select an item to place in the Ert (6) Remove it from shopping cart (inventory: quantity, customer shopping Cart The customer in prented with the contents of the shoppies out it. The item selected is removed from the customer's eart ArrayList and the quantity on-band is increased in the inventory ArrayList. iii. The customer may instead choose to keep the contents of the cart. (e) Purchase items in a shopping cart (Inventory purchase count; enstomer balance, purchase history, shopping cart) 1. Print (to the terminal) a receipt listing the cart items. This includes the name and cont of ach item, plus the total cost of all items. If there are no items in the eart, it is not printed . Increase the purchase count of the items in the inventory ArrayList Deduct the shopping cart total from the customer's balance iv. Add the items to the customer's purchase history v. Empty the shopping cart ArrayList 1. Replace the data in the inventory file with the data currently in the in ventory ArrayList (te, the inventory file is updated so that it is correct) vil. Replace the data in the customer file with the data currently in the cu tomer ArrayList (le, the customer file is updated so that it is correct (d) Return an with restocking fee (ventory: quantity, return bout tomer balance purchase history) Print (to the terminal listing of the purch history. This includes the name and cost of each item. If there are no items in the purch history, alting is not printed Increase the return count of the selected items in the ventory Array i Mid the cost of the returned item to the customer's balance in testocking for iv. Remove the returned item from the customer's purchase history v. Replace the data in the inventory file with the data currently in the Inventory ArrayLin vi. Replace the data in the customer file with the data currently in the cus tomer ArrayList in the customer file is updated so that it is correct)

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 01:30
In deadlock avoidance using banker’s algorithm, what would be the consequence(s) of: (i) a process declaring its maximum need as maximum possible for each resource. in other words, if a resource a has 5 instances, then each process declares its maximum need as 5. (ii) a process declaring its minimum needs as maximum needs. for example, a process may need 2-5 instances of resource a. but it declares its maximum need as 2.
Answers: 3
question
Computers and Technology, 23.06.2019 01:40
Writing a modular program in visual c++. i am new to this and not sure what i am missing. i am getting the following error: baddate.cpp: in function ‘int main()’: baddate.cpp: 50: 3: error: ‘else’ without a previous ‘if’elsehere are the instructions and code: writing a modular program in c++in this lab, you add the input and output statements to a partially completed c++ program. when completed, the user should be able to enter a year, a month, and a day. the program then determines if the date is valid. valid years are those that are greater than 0, valid months include the values 1 through 12, and valid days include the values 1 through 31.notice that variables have been declared for you.write the simulated housekeeping() function that contains the prompts and input statements to retrieve a year, a month, and a day from the user.include the output statements in the simulated endofjob() function. the format of the output is as follows: month/day/year is a valid date.ormonth/day/year is an invalid date.execute the program entering the following date: month = 5, day = 32, year = 2014. record the output of this program.execute the program entering the following date: month = 9, day = 21, year = 2002. record the output of this /* program name: baddate.cppfunction: this program determines if a date entered by the user is valid.input: interactiveoutput: valid date is printed or user is alerted that an invalid date was entered*/#include bool validatedate(int, int, int); using namespace std; int main(){// declare variablesint year; int month; int day; const int min_year = 0, min_month = 1, max_month = 12, min_day = 1, max_day = 31; bool validdate = true; // this is the work of the housekeeping() method// get the year, then the month, then the daycout< < "enter the year"< > year; cout< < "enter the month"< > month; cout< < "enter the day"< > day; // this is the work of the detailloop() method// check to be sure date is validif(year < = min_year) // invalid yearvaliddate = false; else if (month < min_month || month > max_month) // invalid monthvaliddate = false; else if (day < min_day || day > max_day) // invalid dayvaliddate = false; // this is the work of the endofjob() method// test to see if date is valid and output date and whether it is valid or notif(validdate == true); {// output statementcout<
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
*! 20 points! *jeff wants to create a website with interactive and dynamic content. which programming language will he use? a. dhtml b. html c. css d. javascript
Answers: 1
question
Computers and Technology, 23.06.2019 22:30
Jamie has to enter the names, employee id’s, and income of a group of employees into a worksheet. which option will jamie use to describe the data
Answers: 3
You know the right answer?
Write the Java code to simulate an inventory control system and a point of sale system with customer...
Questions
question
Mathematics, 05.11.2021 20:10
question
History, 05.11.2021 20:10
question
Mathematics, 05.11.2021 20:10
question
Geography, 05.11.2021 20:10
question
English, 05.11.2021 20:10