Answer To: ITECH6401 Enterprise ProgrammingAssignment 1 – Individual AssignmentOverviewThis assignment requires...
Snehil answered on May 05 2020
Camera.java
Camera.java
//Class define a camera
public class Camera extends Product
{
private int pixelCount;
//constructor
public Camera(int warranty, String brandName, float screenSize, int pixelCount)
{
super(warranty, brandName, screenSize);
this.pixelCount = pixelCount;
}
//getters and setters
public int getPixelCount()
{
return pixelCount;
}
public void setPixelCount(int pixelCount)
{
this.pixelCount = pixelCount;
}
//Method to convert values to string for printing purposes
public String toString()
{
return "2," + getWarranty() + "," + getBrandName() + "," + getScreenSize() + "," + getPixelCount() + ",1";
}
}
Mobile.java
Mobile.java
//Class define a Mobile
public class Mobile extends Product
{
private String color;
private int storage;
//constructor
public Mobile(int warranty, String brandName, float screenSize, int storage, String color)
{
super(warranty, brandName, screenSize);
this.color = color;
this.storage = storage;
}
//getters and setters
public String getColor()
{
return color;
}
public void setColor(String color)
{
this.color = color;
}
public int getStorage()
{
return storage;
}
public void setStorage(int storage)
{
this.storage = storage;
}
//Method to convert values to string for printing purposes
public String toString()
{
return "1," + getWarranty() + "," + getBrandName() + "," + getScreenSize() + "," + getStorage() + ","
+ getColor() + ",1";
}
}
orders1.txt
1,10
2,20
3,10
1,5
1,15
3,50
orders2.txt
2,10
1,20
1,10
2,5
3,15
2,50
Product.java
Product.java
//Class define a base product which will be used for inheritance
public class Product
{
private int warranty;
private String brandName;
private float screenSize;
//constructor
public Product(int warranty, String brandName, float screenSize)
{
this.warranty = warranty;
this.brandName = brandName;
this.screenSize = screenSize;
}
//getters and setters
public int getWarranty()
{
return warranty;
}
public void setWarranty(int warranty)
{
this.warranty = warranty;
}
public String getBrandName()
{
return brandName;
}
public void setBrandName(String brandName)
{
this.brandName = brandName;
}
public float getScreenSize()
{
return screenSize;
}
public void setScreenSize(float screenSize)
{
this.screenSize = screenSize;
}
}
Report.docx
Class Product
base product which will be used for inheritance
Variables
Scope
String brand
private
int warranty
private
float screenSize
private
Methods
Parameters and return type
Product
Takes int,String,float. Has no return type.
getWarranty
Takes nothing returns int
setWarranty
Takes int returns nothing
getBrandName
Takes nothing returns String
setBrandName
Takes String returns nothing
getWarranty
Takes nothing returns int
getScreenSize
Takes nothing returns float
setScreenSize
Takes float returns nothing
getWarranty
Class Mobile
define a Mobile
Variables
Scope
String color
private
int storageCapacity
private
Methods
Parameters and return type
Mobile
Takes int,String,float,int,String. Has no return type.
getStorage
Takes nothing returns int
setStorage
Takes int returns nothing
getColor
Takes nothing returns String
setColor
Takes String returns nothing
Class Camera
define a Camera
Variables
Scope
int numPixels
private
Methods
Parameters and return type
Camera
Takes int,String,float,int. Has no return type.
getPixelCount
Takes nothing returns int
setPixelCount
Takes int returns nothing
Class Tablet
define a Tablet
Variables
Scope
String operatingSystem
private
int storageCapacity
private
Methods
Parameters and return type
Tablet
Takes...