QuestionQuestion

Problem statement:

You are tasked with writing a simple program that will keep track of items sold by a retail store. We need to keep track of the stock (or a number of specific products available for sale).

Requirements:
The program will now be broken up into methods and store all the inventory in an ArrayList object.
The program will be able to run a report for all inventory details as well as a report for items that are low in stock. Low stock means that there are less than 5 items available for sale.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

import java.util.ArrayList;

public class RetailInventory {

    static ArrayList<Product> inventory = new ArrayList<>();

    public static void main(String[] args) {
       Product computer = new Product("Computer", 1400);
       Product iPhone = new Product("iPhone XR", 400, 600);
       Product Galaxy10 = new Product("Samsung Galaxy S10", 700, 900, "Phone with 128GB memory.");
       Product book = new Book("Starting out with C++", 150.00);
       Product apple = new Food("Fuji Apples", 3.50, "Dec. 1, 2019");

       updateStock(computer, 3);
       updateStock(iPhone, 6);
       updateStock(Galaxy10, 8);
       updateStock(book, 3);
       updateStock(apple, 150);

       addNewProduct(computer);
       addNewProduct(iPhone);
       addNewProduct(Galaxy10);
       addNewProduct(book);
       addNewProduct(apple);

       viewInventoryDetails();

       viewLowStock();
    }
   
    /**
    * this function update the value of stock
    * @param obj
    * @param stock
    */
    public static void updateStock(Product obj , int stock){
       obj.setStock...

By purchasing this solution you'll be able to access the following files:
Solution.zip.

$13.00
for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Computer Science - Other Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats