Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Any kind people can help me with this Java project?? Please....... You will desi

ID: 3570399 • Letter: A

Question

Any kind people can help me with this Java project?? Please.......
You will design an inventory system for a warehouse (imagine the floor manager with a computer running the application).
The warehouse will stock three products: widget1, widget2, widget3.  
Every widget will have a stock number and a cost (hint: that's the base class)
widget1 will have a price (i.e. selling price vs buying cost above) that is 2 x cost as well as a color (orange or blue) that is a string.
widget2 will have a price that is 3 x cost as well as a weight that is an int, either 20lbs or 50lbs.
widget3 will have a price that is 4 x cost as well as a serial number (unrelated to stock number) that is a string.

The main menu will contain the following:

1. add inventory
2. ship inventory
3. inquire inventory
4. quit

Both add and ship will use bulk numbers (i.e. no one will buy 1 of widget2...more like 20-100). Since the floor manager is intelligent you don't have to add in checks on the menu items (he won't enter -732 for instance).  

But, when he chooses ship inventory, he needs to know that the product is available. For example, if he needs 80 of widget1 in orange...he should have inquired that it is available...if not, he needs to add (same as order here for simplicity) more...then ship.

In each case a class-level number (or two, depending on implementation) is needed to keep up with stock and it can be added to or subtracted from as new objects are added or deleted.

You can assume when ordering products, they are the same. For example, an order of 50 widget2 (30 of 20lbs and 20 of 50lbs) will be processed as two orders to make it easier as far as methods and such.
Any kind people can help me with this Java project?? Please.......
You will design an inventory system for a warehouse (imagine the floor manager with a computer running the application).
The warehouse will stock three products: widget1, widget2, widget3.  
Every widget will have a stock number and a cost (hint: that's the base class)
widget1 will have a price (i.e. selling price vs buying cost above) that is 2 x cost as well as a color (orange or blue) that is a string.
widget2 will have a price that is 3 x cost as well as a weight that is an int, either 20lbs or 50lbs.
widget3 will have a price that is 4 x cost as well as a serial number (unrelated to stock number) that is a string.

The main menu will contain the following:

1. add inventory
2. ship inventory
3. inquire inventory
4. quit

Both add and ship will use bulk numbers (i.e. no one will buy 1 of widget2...more like 20-100). Since the floor manager is intelligent you don't have to add in checks on the menu items (he won't enter -732 for instance).  

But, when he chooses ship inventory, he needs to know that the product is available. For example, if he needs 80 of widget1 in orange...he should have inquired that it is available...if not, he needs to add (same as order here for simplicity) more...then ship.

In each case a class-level number (or two, depending on implementation) is needed to keep up with stock and it can be added to or subtracted from as new objects are added or deleted.

You can assume when ordering products, they are the same. For example, an order of 50 widget2 (30 of 20lbs and 20 of 50lbs) will be processed as two orders to make it easier as far as methods and such.

You will design an inventory system for a warehouse (imagine the floor manager with a computer running the application).
The warehouse will stock three products: widget1, widget2, widget3.  
Every widget will have a stock number and a cost (hint: that's the base class)
widget1 will have a price (i.e. selling price vs buying cost above) that is 2 x cost as well as a color (orange or blue) that is a string.
widget2 will have a price that is 3 x cost as well as a weight that is an int, either 20lbs or 50lbs.
widget3 will have a price that is 4 x cost as well as a serial number (unrelated to stock number) that is a string.

The main menu will contain the following:

1. add inventory
2. ship inventory
3. inquire inventory
4. quit

Both add and ship will use bulk numbers (i.e. no one will buy 1 of widget2...more like 20-100). Since the floor manager is intelligent you don't have to add in checks on the menu items (he won't enter -732 for instance).  

But, when he chooses ship inventory, he needs to know that the product is available. For example, if he needs 80 of widget1 in orange...he should have inquired that it is available...if not, he needs to add (same as order here for simplicity) more...then ship.

In each case a class-level number (or two, depending on implementation) is needed to keep up with stock and it can be added to or subtracted from as new objects are added or deleted.

You can assume when ordering products, they are the same. For example, an order of 50 widget2 (30 of 20lbs and 20 of 50lbs) will be processed as two orders to make it easier as far as methods and such.
You will design an inventory system for a warehouse (imagine the floor manager with a computer running the application).
The warehouse will stock three products: widget1, widget2, widget3.  
Every widget will have a stock number and a cost (hint: that's the base class)
widget1 will have a price (i.e. selling price vs buying cost above) that is 2 x cost as well as a color (orange or blue) that is a string.
widget2 will have a price that is 3 x cost as well as a weight that is an int, either 20lbs or 50lbs.
You will design an inventory system for a warehouse (imagine the floor manager with a computer running the application).
The warehouse will stock three products: widget1, widget2, widget3.  
Every widget will have a stock number and a cost (hint: that's the base class)
widget1 will have a price (i.e. selling price vs buying cost above) that is 2 x cost as well as a color (orange or blue) that is a string.
You will design an inventory system for a warehouse (imagine the floor manager with a computer running the application).
The warehouse will stock three products: widget1, widget2, widget3.  
Every widget will have a stock number and a cost (hint: that's the base class)
You will design an inventory system for a warehouse (imagine the floor manager with a computer running the application).
The warehouse will stock three products: widget1, widget2, widget3.  
You will design an inventory system for a warehouse (imagine the floor manager with a computer running the application).

The main menu will contain the following:

1. add inventory
2. ship inventory
3. inquire inventory
4. quit

Both add and ship will use bulk numbers (i.e. no one will buy 1 of widget2...more like 20-100). Since the floor manager is intelligent you don't have to add in checks on the menu items (he won't enter -732 for instance).  

But, when he chooses ship inventory, he needs to know that the product is available. For example, if he needs 80 of widget1 in orange...he should have inquired that it is available...if not, he needs to add (same as order here for simplicity) more...then ship.

In each case a class-level number (or two, depending on implementation) is needed to keep up with stock and it can be added to or subtracted from as new objects are added or deleted.

You can assume when ordering products, they are the same. For example, an order of 50 widget2 (30 of 20lbs and 20 of 50lbs) will be processed as two orders to make it easier as far as methods and such.

The main menu will contain the following:

1. add inventory
2. ship inventory
3. inquire inventory
4. quit

Both add and ship will use bulk numbers (i.e. no one will buy 1 of widget2...more like 20-100). Since the floor manager is intelligent you don't have to add in checks on the menu items (he won't enter -732 for instance).  

But, when he chooses ship inventory, he needs to know that the product is available. For example, if he needs 80 of widget1 in orange...he should have inquired that it is available...if not, he needs to add (same as order here for simplicity) more...then ship.

In each case a class-level number (or two, depending on implementation) is needed to keep up with stock and it can be added to or subtracted from as new objects are added or deleted.

You can assume when ordering products, they are the same. For example, an order of 50 widget2 (30 of 20lbs and 20 of 50lbs) will be processed as two orders to make it easier as far as methods and such.

Explanation / Answer

import java.util.Scanner;


class Widget
{
int stockNumber;
double cost;

public Widget(int stockNumber, double cost)
{
  this.stockNumber = stockNumber;
  this.cost = cost;  
}
public int getStockNumber() {
  return stockNumber;
}
public void setStockNumber(int stockNumber) {
  this.stockNumber = stockNumber;
}
public double getCost() {
  return cost;
}
public void setCost(double cost) {
  this.cost = cost;
}

}

class Widget1 extends Widget
{
double price;
String color;
public Widget1(int stockNumber,double cost, double price, String color)
{  
  super(stockNumber, cost);
  this.price = 2 * super.cost;
  this.color = color;
}
public double getPrice() {
  return price;
}
public void setPrice(double price) {
  this.price = price;
}
public String getColor() {
  return color;
}
public void setColor(String color) {
  this.color = color;
}

}


class Widget2 extends Widget
{
double price;
int weight;
public Widget2(int stockNumber,double cost, double price, int weight)
{  
  super(stockNumber, cost);
  this.price = 3 * super.cost;
  this.weight = weight;
}
public double getPrice() {
  return price;
}
public void setPrice(double price) {
  this.price = price;
}
public int getWeight() {
  return weight;
}
public void setWeight(int weight) {
  this.weight = weight;
}

}


class Widget3 extends Widget
{
double price;
String serialNumber;
public Widget3(int stockNumber,double cost, double price, String serialNumber)
{  
  super(stockNumber, cost);
  this.price = 2 * super.cost;
  this.serialNumber = serialNumber;
}
public double getPrice() {
  return price;
}
public void setPrice(double price) {
  this.price = price;
}
public String getSerialNumber() {
  return serialNumber;
}
public void setSerialNumber(String serialNumber) {
  this.serialNumber = serialNumber;
}

}

class Management
{
int [] count = new int[3] ;
Scanner sc = new Scanner(System.in);
public void addInventory(String name, int countValue)
{
  if(name.equalsIgnoreCase("widget1"))
  {
   count[0] += countValue;
  }  
  else if(name.equalsIgnoreCase("widget2"))
  {
   System.out.println(" Enter the count");
   count[1] += countValue;
   System.out.println("The number of widget1 are "+count[1]);
  }
  else if(name.equalsIgnoreCase("widget3"))
  {
   System.out.println(" Enter the count");
   count[2] += countValue;
   System.out.println("The number of widget1 are "+count[2]);
  }
  else
  {
   System.out.println(" Only Widget1,Widget2,Widget3 can be added");
  }
}

public void shipInventory()
{
  System.out.println("Enter the Inventory name");
  String name = sc.next();
  if(name.equalsIgnoreCase("widget1"))
  {
   System.out.println(" Enter the count");
    int temp = sc.nextInt();
    if(inquireInventory(temp,name))
    {
     count[0] -= temp;
    }
    else
    {
     System.out.println(" Out of Stock. Adding the count to the Inventory");
     addInventory("widget1",temp);
    }
  }
  else if(name.equalsIgnoreCase("widget2"))
  {
   System.out.println(" Enter the count");
    int temp = sc.nextInt();
    if(inquireInventory(temp,name))
    {
     count[1] -= temp;
    }
    else
    {
     System.out.println(" Out of Stock. Adding the count to the Inventory");
     addInventory("widget2",temp);
    }
  }
  else if(name.equalsIgnoreCase("widget3"))
  {
   System.out.println(" Enter the count");
    int temp = sc.nextInt();
    if(inquireInventory(temp,name))
    {
     count[2] -= temp;
    }
    else
    {
     System.out.println(" Out of Stock. Adding the count to the Inventory");
     addInventory("widget3",temp);
    }
  }
  else
  {
   System.out.println(" Only Widget1,Widget2,Widget3 can be added");
  }
  
}


public boolean inquireInventory(int orderCount, String name)
{
  if(name.equalsIgnoreCase("widget1"))
  {
   if(count[0] > orderCount)
    return true;
  }  
  else if(name.equalsIgnoreCase("widget2"))
  {
   if(count[1] > orderCount)
    return true;
  }
  else if(name.equalsIgnoreCase("widget3"))
  {
   if(count[2] > orderCount)
    return true;
  }
  else
  {
   System.out.println(" Only Widget1,Widget2,Widget3 can be added");
  }
  return false;  
}
}

public class MyInventory
{


public static void main(String arg[])
{
  int choice = 4;  
  Scanner sc = new Scanner(System.in);
  String name;
  int countValue;
  Management ob = new Management();
  do
  {
   System.out.println("1. add inventory");
   System.out.println("2. ship inventory");
   System.out.println("3. inquire inventory");
   System.out.println("4. quit");  
   choice = sc.nextInt();
   
   
   switch(choice)
   {
   case 1:
    System.out.println("Enter the Inventory name");
    name = sc.next();   
    System.out.println(" Enter the count");
    countValue= sc.nextInt();
    ob.addInventory(name, countValue);break;
   case 2:
    ob.shipInventory();break;
   case 3:
    System.out.println("Enter the Inventory name");
    name = sc.next();   
    System.out.println(" Enter the count");
    countValue= sc.nextInt();
    boolean result = ob.inquireInventory(countValue,name);break;    
   case 4:
    break;
   }
  }while(choice != 4);
  
}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote