Camera.java
Camera.java
public class Camera extends Product
{
private int numPixels;
public Camera(int warranty, String brand, float screenSize, int numPixels)
{
super(warranty, brand, screenSize);
this.numPixels = numPixels;
}
public int getNumPixels()
{
return numPixels;
}
public void setNumPixels(int numPixels)
{
this.numPixels = numPixels;
}
}
Mobile.java
Mobile.java
public class Mobile extends Product
{
private String color;
private int storageCapacity;
public Mobile(int warranty, String brandName, float screenSize, int storageCapacity, String color)
{
super(warranty, brandName, screenSize);
this.color = color;
this.storageCapacity = storageCapacity;
}
public String getColor()
{
return color;
}
public void setColor(String color)
{
this.color = color;
}
public int getStorageCapacity()
{
return storageCapacity;
}
public void setStorageCapacity(int storageCapacity)
{
this.storageCapacity = storageCapacity;
}
}
Orders.txt
1,10
2,20
3,30
Orders1.txt
1,50
2,20
3,80
Orders2.txt
1,10
2,20
3,10
Product.java
Product.java
public class Product
{
private String brand;
private int warranty;
private float screenSize;
public Product(int warranty, String brand, float screenSize)
{
this.warranty = warranty;
this.brand = brand;
this.screenSize = screenSize;
}
public int getWarranty()
{
return warranty;
}
public void setWarranty(int warranty)
{
this.warranty = warranty;
}
public String getBrand()
{
return brand;
}
public void setBrand(String brand)
{
this.brand = brand;
}
public float getScreenSize()
{
return screenSize;
}
public void setScreenSize(float screenSize)
{
this.screenSize = screenSize;
}
}
Report.docx
Class Product
Base class, to be used for inheritance
Variables
Scope
String brand
private
int warranty
private
float screenSize
private
Methods
Parameters and return type
Getters and setters
Parameters and return type based on variable
Constructor
Parameters int, String , float. No return type
Class Mobile
To create objects which hold information for mobiles
Variables
Scope
String color
private
int storageCapacity
private
Methods
Parameters and return type
Getters and setters
Parameters and return type based on variable
Constructor
Parameters based on base class and int, String. No return type
Class Camera
To create objects which hold information for cameras
Variables
Scope
int numPixels
private
Methods
Parameters and return type
Getters and setters
Parameters and return type based on variable
Constructor
Parameters based on base class and int. No return type
Class Tablet
To create objects which hold information for tablets
Variables
Scope
String operatingSystem
private
int storageCapacity
private
Methods
Parameters and return type
Getters and setters
Parameters and return type based on variable
Constructor
Parameters based on base class and int, String. No return type
Interface StockLimit
Holds minimum and maximum stock limit constants
Variables
Scope
final int MINIMUM_STOCK
default
final int MAXIMUM_STOCK
default
Class StockLimitException
To throw exception when stock limit is crossed
Methods
Parameters and return type
Constructor
Parameters based on base class. No return type
Class Stocks
To define various operations for processing stocks
Variables
Scope
List
mobileList
private
List cameraList
private
List tabletList
private
Methods
Parameters and return type
Constructor
No parameters. No return type
displayStocks
No parameters. Return type void.
readData
Parameters String. Return type List
writeFinalStocks
No parameters. Return type void.
readOrders
Parameters String. Return type void.
readStocks
Parameters String. Return type void.
Class Repository
To test the functionality of the project
Methods
Parameters and return type
main
Parameters String[]. Return type...