Problem Description: Sahara Green's You have been recently employed by Sahara Greens, a fresh produce store...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Problem Description: Sahara Green's You have been recently employed by Sahara Greens, a fresh produce store which specialises in selling the freshest local fruits and vegetables at the most affordable prices. This store's vision is to provide its customers with up-to-date information about all available products and always maintain enough stock so there is least wastage and, hence, guarantee freshness. In order for this to be realised, they need a system that keeps track of all available stock and the sell-by dates for these vegetables so that they are sold as early as possible to maintain its company's vision for freshness and affordability. Freshness is achieved if products are sold by their sell-by date. The sell-by date indicates the date by which the freshness is guaranteed. By company policy, the sell-by date is within two days of purchase. Affordability of these products to its customers is achieved if products are not wasted therefore preventing loss for the business. This gain is passed on to the customers in terms of affordable prices. For each fruit or vegetable (product), Sahara Green keeps the following information: product code (int) product name (String) . cost (double) quantity (int) sell-by date (Date) You have been tasked to create a program that allows Sahara Green to keep inventory of all products and generate a few predefined reports. The system should allow the user (employees) to: 1. Add product details to the system. 2. Search and edit/update the product cost. 3. Search and edit/update the product quantity. 4. Search for a product and display all details for that product. 5. Search and list all products that must be sold within two days (current day) as per the company policy to guarantee freshness. 6. Display a list of all products. Product Class After discussions with your team, you have come up with the following classes: CSC621-Data Structures & Algorithms Semester 1- 2022 code: int Node name:String head: Node LinkedList() LinkedList cost:double quantity: double sellby:Date next:Node Node() getName():String getCost():double isEmpty(): boolean isFull(): boolean insert(code:int, name:String, cost:double, quantity:double, sellby: Date): boolean update_cost(code:int, newcost: double) update_quantity(code:int, newquantity: double) search(code:int) mustsell(); display(); setName(name: String) setCost(cost:double) getQuantity():double setQuantity(quantity:double) getCode():int setCode(code:int) getSellby(): Date setSellby(sellby: Date) getNext():Node setNext(next: Node) Main(); Main Implementation You are to create this system in Java using a singly linked list data structure where each node in your linked list represents a product sold by Sahara Green. Read the problem description carefully and use the class diagram given above to complete the implementation. Your program must satisfy the following: 1. Design a menu based program with these choices (you may either use a number or string/character menu similar to your labs): a. Insert - if the user chooses this option, the program will ask the user for the product details and add this product to the linked list. You may select any insertion method: insert at the head, tail or middle. b. Update Cost - if the user chooses this option, the program will ask the user for the product code for which they want to update the cost and the new cost. This information will be used to search the linked list for the product and then update its cost. c. Update Quantity - if the user chooses this option, the program will ask the user for the product code for which they want to update the quantity and the new quantity. This information will be used to search the linked list for the product and then update its quantity. d. Search this option allows the user to search for a product using its code. Once a code is entered, the program searches for the code and displays all its details. If the product code is not found, an appropriate message must be displayed. Use a neat, tabular format when displaying items. Add lines and tab spaces to separate products. e. Must Sell Products - when this option is chosen, the program must look through all items and display those products which must be sold within 2 days (+2 days) from now, where now is the current date. You do not need to ask the user to enter a date. Use the system date and display all items whose sell-by date is +2 days from now). Use a neat, tabular format when displaying items. Add lines and tab spaces to separate products. f. Display - this option displays all the products and product details in the system. Use a neat, tabular format when displaying items. Add lines and tab spaces to separate products. g. Quit this option terminates the program. Coding Guidelines Ensure you meet the following coding requirements: Use proper indentation. Use comments where possible. Use two decimal places when currencies. Use validation to prevent input errors. Catch input errors and display appropriate error messages allowing the user to re-enter data. Use proper formatting for outputs so that data can be read easily. Problem Description: Sahara Green's You have been recently employed by Sahara Greens, a fresh produce store which specialises in selling the freshest local fruits and vegetables at the most affordable prices. This store's vision is to provide its customers with up-to-date information about all available products and always maintain enough stock so there is least wastage and, hence, guarantee freshness. In order for this to be realised, they need a system that keeps track of all available stock and the sell-by dates for these vegetables so that they are sold as early as possible to maintain its company's vision for freshness and affordability. Freshness is achieved if products are sold by their sell-by date. The sell-by date indicates the date by which the freshness is guaranteed. By company policy, the sell-by date is within two days of purchase. Affordability of these products to its customers is achieved if products are not wasted therefore preventing loss for the business. This gain is passed on to the customers in terms of affordable prices. For each fruit or vegetable (product), Sahara Green keeps the following information: product code (int) product name (String) . cost (double) quantity (int) sell-by date (Date) You have been tasked to create a program that allows Sahara Green to keep inventory of all products and generate a few predefined reports. The system should allow the user (employees) to: 1. Add product details to the system. 2. Search and edit/update the product cost. 3. Search and edit/update the product quantity. 4. Search for a product and display all details for that product. 5. Search and list all products that must be sold within two days (current day) as per the company policy to guarantee freshness. 6. Display a list of all products. Product Class After discussions with your team, you have come up with the following classes: CSC621-Data Structures & Algorithms Semester 1- 2022 code: int Node name:String head: Node LinkedList() LinkedList cost:double quantity: double sellby:Date next:Node Node() getName():String getCost():double isEmpty(): boolean isFull(): boolean insert(code:int, name:String, cost:double, quantity:double, sellby: Date): boolean update_cost(code:int, newcost: double) update_quantity(code:int, newquantity: double) search(code:int) mustsell(); display(); setName(name: String) setCost(cost:double) getQuantity():double setQuantity(quantity:double) getCode():int setCode(code:int) getSellby(): Date setSellby(sellby: Date) getNext():Node setNext(next: Node) Main(); Main Implementation You are to create this system in Java using a singly linked list data structure where each node in your linked list represents a product sold by Sahara Green. Read the problem description carefully and use the class diagram given above to complete the implementation. Your program must satisfy the following: 1. Design a menu based program with these choices (you may either use a number or string/character menu similar to your labs): a. Insert - if the user chooses this option, the program will ask the user for the product details and add this product to the linked list. You may select any insertion method: insert at the head, tail or middle. b. Update Cost - if the user chooses this option, the program will ask the user for the product code for which they want to update the cost and the new cost. This information will be used to search the linked list for the product and then update its cost. c. Update Quantity - if the user chooses this option, the program will ask the user for the product code for which they want to update the quantity and the new quantity. This information will be used to search the linked list for the product and then update its quantity. d. Search this option allows the user to search for a product using its code. Once a code is entered, the program searches for the code and displays all its details. If the product code is not found, an appropriate message must be displayed. Use a neat, tabular format when displaying items. Add lines and tab spaces to separate products. e. Must Sell Products - when this option is chosen, the program must look through all items and display those products which must be sold within 2 days (+2 days) from now, where now is the current date. You do not need to ask the user to enter a date. Use the system date and display all items whose sell-by date is +2 days from now). Use a neat, tabular format when displaying items. Add lines and tab spaces to separate products. f. Display - this option displays all the products and product details in the system. Use a neat, tabular format when displaying items. Add lines and tab spaces to separate products. g. Quit this option terminates the program. Coding Guidelines Ensure you meet the following coding requirements: Use proper indentation. Use comments where possible. Use two decimal places when currencies. Use validation to prevent input errors. Catch input errors and display appropriate error messages allowing the user to re-enter data. Use proper formatting for outputs so that data can be read easily.
Expert Answer:
Posted Date:
Students also viewed these programming questions
-
Organizing Data 1. What is the difference between qualitative and quantitative data? 2. Provide one example for a numerical discrete, numerical continuous, categorical nominal, and categorical...
-
QUESTION 31 A______________________isthe profit from an investment in an asset,such asstocks,bonds,mutualfunds and ETFs. Preferred Dividend Ordinary Income Capital gain Assets
-
Stockton Mineral Operation, Incorporated (SMO), currently has 505,000 shares of stock outstanding that sell for $80 per share. Assuming no market imperfections or tax effects exist, what will the...
-
Let Go n! + 1, where n is a positive integer. We will generate a sequence of primes by performing the following steps. Begin by finding P which is any prime divisor of G, then compute P2 by finding...
-
Discuss the advantages and disadvantages of using the Classical Approach to hypothesis testing. Discuss the advantages and disadvantages of using the P-value approach to hypothesis testing.
-
Last week June worked 50.5 hours. She is paid $15.80 per hour for a regular workweek of 44 hours and overtime at time-and-a-half regular pay. (a) What were Junes gross wages for last week? (b) What...
-
Relate the concept of work measurement to the system implementation process.
-
Total June 2010 sales for Roys Catering are expected to be $450,000. Of each months sales, 80 percent is expected to be on credit. The Accounts Receivable balance at May 31 is $119,600; of which...
-
Assume that western exploration Corp. is considering the acquisition of Ogden drilling company . The latter has a $580,000 tax loss carry forward. Projected earnings for the western exploration Corp....
-
Two companies competing in the same industry are being evaluated by a bank that can lend money to only one of them. Summary information from the financial statements of the two companies follows:...
-
Debate issue - Take a stand Ethical businesses are the most profitable (cite 2 reliable sources). 3 00 word s minimum The most ethical businesses are not the most profitable (cite 2 reliable...
-
One of IBM's bond issues has an annual coupon rate of 3.5%, a face value of $1,000 and matures in 13 years. Part 1 BAttempt 1/10 for 10 pts. What is the value (or price) of the bond if the required...
-
The serratus anterior muscle normally originates from the firstnine ribs and inserts into the medial border of the scapula. Predict its action from this information (connect your answer tothis...
-
Coronado's CVP income statement included sales of 6000 units, unit selling price of $100, unit variable cost of $60, and fixed expenses of $160000. Contribution margin is
-
Your company is deciding whether to invest in a new machine. The new machine will increase cash flow by $352,000 per year. You believe the technology used in the machine has a 10-year life; in other...
-
ces Vessel operating costs Advertising Administrative costs Insurance Fixed Cost per Month $ 6,500 $2,200 $ 5,800 $ 3,500 Cost per Cruise $ 478.00 Cost per Passenger $ 3.50 $ 38.00 $ 1.50 For...
-
Consolidation related simulation example: Millennium Capital Management, Inc., (MCM) acquired a 90% interest in NextGen, Inc. MCM's Financial Manager, Matthew Steven, has prepared a draft memo to the...
-
Provide examples of a situations in which environmental disruptions affected consumer attitudes and buying behaviors.
-
Preferred stock that may be converted into common stock has which of the following characteristics? a. Call feature b. Cumulative feature c. Participation feature d. Convertible feature
-
A dividend that is paid every quarter or every year is called? a. Regular dividend b. Special dividend c. Property dividend d. Stock dividend
-
What is the meaning of each of the following terms: corporation, articles of incorporation, corporate charter, board of directors, corporate officers, and organization costs?
Study smarter with the SolutionInn App