Sunday, February 8, 2009

DirecClothing Case Study

/*** Programmer: Bocong, Wendel B.Name of Program: Catalog Class (Case study of direct Clothing)
Date Started : February 6,2009

Date Ended: February 9,2009

Purpose: Seeking for an implementation for CASE STUDY OF DIRECT CLOTHING***/


public class Order{


private int Orderid;
private double Totalprice;
private String Status;

public Order()
{
}

public Order(int newoid, double newtot, String newsta)
{
Orderid=newoid;
Totalprice=newtot;
Status=newsta;
}


public void Ordercancel(int newoid)
{
Orderid=newoid;
System.out.print("Order has been cancelled"+Orderid);
}

public void addorder()
{
System.out.println("The following shirt has been added to your order"+Orderid);
}
}




/*** Programmer: Bocong, Wendel B.
Name of Program: Catalog Class (Case study of direct Clothing)
Date Started : February 6,2009
Date Ended: February 9,2009

Purpose: Seeking for an implementation for cASE STUDY OF DIRECT CLOTHING***/


public class Shirt
{
public int Shirtid;
private double Price;
private String Color;
private String Description;
private int Quantity;

public Shirt(int newsid, double newpri, String newcol, String newdes, int newqua)
{
Shirtid=newsid;
Price=newpri;
Color=newcol;
Description=newdes;
Quantity=newqua;
}

public void addstock(int newsid)
{
Shirtid=newsid;
System.out.println("You just new Shirt " +Shirtid+ " to your stock.");
}

public void cancelorder(int newsid)
{
Shirtid=newsid;
System.out.println("You just remove " +Shirtid+ " from your stock. ");
}
}



/*** Programmer: Bocong, Wendel B.
Name of Program: Catalog Class (Case study of direct Clothing)
Date Started : February 6,2009
Date Ended: February 9,2009

Purpose: Seeking for an implementation for CASE STUDY OF DIRECT CLOTHING***/


public class Catalog
{

private int Shirtid;
private String Color;
private double Price;
private int Quantityinstock;
private String Description;

public Catalog( )

{

}

public Catalog(int sid, double pri, String des,String col, int qua)
{
Shirtid=sid;
Color=col;
Price=pri;
Description=des;
Quantityinstock=qua;
}


public void addshirt(int newsid, double newpri, String newcol, String newdes, int newqua)
{
Shirtid=newsid;
Price=newpri;
Color=newcol;
Description=newdes;
Quantityinstock=newqua;

System.out.println("Shirt number: "+Shirtid);
System.out.println("\nPrice: "+Price);
System.out.println("\nColor: "+Color);
System.out.println("\nDescription: "+Description);
System.out.println("\nQuantity in Stock: "+Quantityinstock);

System.out.println("Add of Product is successful!");

}


public void removeashirt(int newShirtid)
{
Shirtid=newShirtid;
System.out.println("The Shirt number"+Shirtid+"is succesfully removed from the order");
}
}


/*** Programmer: Bocong, Wendel B.
Name of Program: Catalog Class (Case study of direct Clothing)
Date Started : February 6,2009
Date Ended: February 9,2009
Purpose: Seeking for an implementation for CASE STUDY OF DIRECT CLOTHING***/


public class Formofpayment
{

private int Checknumber;
private int Cardnumber;
private String Expiredate;

public Formofpayment( )
{
}

public Formofpayment(int newche,int newcar,String newexp)
{
Checknumber=newche;
Cardnumber=newcar;
Expiredate=newexp;
}

public void verifyCardnumber(int newche)
{
if(Cardnumber==newche){
Cardnumber=newche;
System.out.println("Card Number has been verified!");}

else{
System.out.println("Please Check because your card number is Invalid");
}
}
public void verifyCheckPayment(int newche)
{
if(Checknumber==newche){
Checknumber=newche;
System.out.println("Check Number has been Verified!");}

else{
System.out.println("Please Check because your Check Number is Invalid");

}
}
}


/*** Programmer: Bocong, Wendel B.
Name of Program: Catalog Class (Case study of direct Clothing)
Date Started : February 6,2009
Date Ended: February 9,2009
Purpose: Seeking for an implementation for CASE STUDY OF DIRECT CLOTHING***/


public class Customer {

  private int Customerid;
  private String Name;
  private String Address;
  private int PhoneNumber;
  private String emailadd;
   
 
 private void placeOrder(){
  System.out.print(Name+"\n, from "+Address);
  System.out.print("has a phone number "+PhoneNumber);
  System.out.print("\n and email add "+emailadd+" have an order.");
  Order bench = new Order(2,780.00,"available and in stock");
 }

 private void cancelOrder(){
  System.out.print("\nCancelled order!");
  Order bench = new Order();
 }

 public Customer(int cid, String cname, String cadd, int cnum, String cemail){
  Customerid = cid;
  Name = cname;
  Address = cadd;
  PhoneNumber = cnum;
  emailadd = cemail;
  this.placeOrder();
 }
  public Customer(){
  this.cancelOrder();
  }

}


Wednesday, February 4, 2009

// programmer:Wendel B. Bocong
// date started: February 4, 2009
// date ended: February 4, 2009
// Programme name: Cube Exercise
// programme purpose: Implementing Class Through Visibility Modifier in JAVA

import java.util.Scanner;
public class CubeTester{

  public static void main(String[] args) {
      
    double w;
    double e;
    double n;

      
      Cube myCube1 = new Cube(8,10,5);
      myCube1.displayCube();
    
    
    Scanner a=new Scanner(System.in);
    System.out.println("length:");
    w=a.nextDouble();

    Scanner b=new Scanner(System.in);
    System.out.println("height:");
    e=b.nextDouble();
    
    Scanner c=new Scanner(System.in);
    System.out.println("width:");
    n=c.nextDouble();

        Cube myCube2=new Cube();    
        myCube2.SetDimension(w,e,n);
        myCube2.displayCube();     
  }
   
}



// programmer:Wendel B. Bocong
// date started: February 4, 2009
// date ended: February 4, 2009
// Programme name: Cube Exercise
// programme purpose: Implementing Class Through Visibility Modifier in JAVA


public class Cube{

    private double length;
    private double width;
    private double heigth;
    private double volume;
    private double area;



    public Cube(double w, double e, double n)
    {
    length=w;
    heigth=e;
    width=n;
    }

    public Cube( )
    {

    }



  private double area()
  {
      return (width*length);  
  }




  private double volume()
  {
    return(length*width*heigth);
  }


    public void SetDimension (double newlen, double newhei, double newwid)
    {
     length=newlen;
     width=newwid;
     heigth=newhei;
    }


  public void displayCube()
  {
      System.out.println("the area of the cube is " +area());
      System.out.println("the volume of the cube is " +volume());
  }
}