Monday, February 9, 2009

Direct Clothing

/**Programmer:Tomarocon Rolando
 * Purpose:To apply Knowledge we learn from OOP
 *Date :Feb 9,2009
 *Instructor:Dony Dongiapon
 */

public class Catalog {
 
private int shirtID;
private int price;
private String color;
private String description;


public Catalog()
{

}

public Catalog(int s, int pri, String col, String des)
{
shirtID=s;
price=pri;
color=col;
description=des;
}

//add method
public void add(int newshirtID)
{
shirtID=newshirtID;
}
//remove method
public void remove(int newshirtID)
{
shirtID=newshirtID;
}

}

------------------------------------------------------------------------------------------

public class Customer{

 private int customerid;
 private String name;
 private String address;
 private int phonenumber;
 private String emailaddress;


 //constructor for customer

 public Customer(){
 }


 public void customerprofile(String newname, int newid, String newaddress,int newphonenumber, String newemailaddress)
 {
 name=newname;
 address=newaddress;
 customerid=newid;
 phonenumber=newphonenumber;
 emailaddress=newemailaddress;
 }
 
public void placeOrder()
{
}
public void cancelOrder()
{
}



}
------------------------------------------------------------------------------

public class Order{ 
 
 private String orderID; 
 private double totalprice; 
 private String status;
 
 public Order(){
 }
 public void orderShirt(String neworderID,double newtotalorderprice,String newstatus)
 { 
 
 //constructor for order
 
 orderID=neworderID;
 totalorderprice=newtotalorderprice; 
 status=newstatus;
 }
 public void setOrderID(String neworderID)
 {
 String orderID=neworderID;
 }
 public String getOrderID()
 { 
 return orderID;
 }
 //method for order

 public void setTotaltorderprice(double newtotalorderprice)
 { 
  totalorderprice=newtotalorderprice;}
 public double getTotaltorderprice(){ 
 return totalorderprice;
 }
 public void setStatus(String newstatus)
 { 
 status=newstatus;}
 public String getStatus()
 { 
 return status;
 }
}
--------------------------------------------------------------------------

public class Shirt {
 
 //variable

 private String shirtID;
  private double price;
  private String color; 
 private int quantity;
  private String description;

 public Shirt(){ 
 }
 public Shirt(String newshirtID,double newprice,String newcolor, int newquantity,String newdescription){ 

 //constructor

 shirtID= newshirtID; 
 price=newprice; 
 color= newcolor; 
 quantity=newquantity; 
 description=newdescription;
 }
 //method 
 
 public void setShirtID(String newshirtID){ 
 shirtID= newshirtID; }
 public String getShirtID()
 { 
 return shirtID;} 
 public void setPrice(double newprice)
 { 
 price=newprice;}
 public double getPrice()
 { 
 return price;}
 public void setColor(String newcolor)
 {
  color= newcolor;}
 public String getColor()
 {
  return color;}
 public void setQuantity(int newquantity)
 {
  quantity=newquantity;}
 
 public int getQuantity()
 { 
 return quantity;}

 public void setDescription(String newdescription)
 { 
 description=newdescription;}
 public String getDescription()
 { 
 return description;}
 
 //add method
public void add(int newshirtID)
{
shirtID=newshirtID;
}


//remove method
public void remove(int newshirtID)
{
shirtID=newshirtID;
}
-----------------------------------------------------------------------------

public class FormofPayment{ 


 private String checknumber; 
 private String cardnumber; 
 private String expirationDate;
 
 public FormofPayment(String c,String ca,String d)

 //constructor{
 
 checknumber=c; 
 cardnumber=ca; 
 expirationDate=d; 
 }
 //method
 public void setChecknumber(String check){
 
 checknumber=c;
 } 

 public String getChecknumber(){
 
 return checknumber;
 }
 
 public void setCardnumber(String card){ 

 cardnumber=ca;
 } 
 
 public String getCardnumber(){ 

 return cardnumber;
 }
 
 public void setExpirationdate(String date){ 
 expirationDate=d;
 } 

 public String getExpirationdate(){ 
 returnexpirationDate;
 }
 public void Dispalymessage()
 { 
 System.out.println("Your checknumber is:%s");
 }
}

Wednesday, February 4, 2009

Programming 3

/*Programmer:Tomarocon,Rolando
Program Title:Cube
Date:Feb 4, 2009
Purpose: To create a source code of a cube*/

public class Cube{

private double cubewidth;
private double cubelength;
private double cubeheight;
private double cubevolume;
private double cubearea;

  public Cube(double width, double height, double length)
{
this.cubewidth=width;
this.cubeheight=height;
this.cubelength=length;
}

 public Cube(){
}
private double volume(){
return (cubewidth*cubelength*cubeheight); 
}
private double area(){
return (cubewidth*cubelength); 
}
public void setDimension(double newwidth, double newheight, double newlength)
{
this.cubewidth=newwidth;
this.cubeheight=newheight;
this.cubelength=newlength;
}
public String displayCube(){
return String.format(volume()+" and "+area());

  }
}


/*Programmer:Tomarocon.Rolando
Program Title:CubeTester
Date:Feb 4, 2009

Purpose: To test the cube*/


public class CubeTester{
public static void main(String[] args){
   
    Cube myCube1=new Cube(2,2,2);
       myCube.displayCube();
  cube myNewCube = new cube();
  myNewCube.displayCube();


}
}