Monday, February 9, 2009
Direct Clothing Case Study
Program Name:Shirt class
Date Started: 02/09/09
Date Finished: 02/09/09
Program Purpose:To create a code for the purpose of our midterm exam.
*/
public class Shirt
{
private String shirtID;
private double price;
private String color;
private int quantity;
private String description;
public Shirt()
{
}
//constructor
public Shirt(String newshirtID,double newprice,String newcolor,int newquantity,String newdescription)
{
shirtid=newShirtID;
price=newprice;
color=newcolor;
quantity=newquantity;
description=newdescription;
}
//method
add stock void shirtid(String newShirtID)
{
shirtID=newShritID;
}
public void giveprice(double newprice)
{
price=newprice;
}
public double getprice(double newprice)
{
return price;
}
public void givecolor(String color)
{
color=newcolor;
}
public void getcolor(String color)
{
return color;
}
public void givequantity(int quantity)
{
quantity=newquantity;
}
public int getquantity(int quantity)
{
return quantity;
}
public void givedescription(String description)
{
description=newdescription;
}
public String(String description)
{
return description;
}
public String removestock()
{
}
}
Customer Class
public class Customer
{
private int CustomerID;
private String Name;
private String Address;
private int Phonenumber;
private String Emailaddress;
//constructor
public Customer()
{
}
public Customer(int c, String n, String a, int p, String e)
{
CustomerID=c;
Name=n;
Address=a;
Phonenumber=p;
Emailaddress=e;
}
//methods
public void customergreetings(String newname)
{
Name=newname;
System.out.println(" Welcome to Direct Clothing" "+name+");
}
public void customerprofile(String newname, int newid, String newaddress, int newphonenumber, String newemailaddress)
{
Name=newname;
Address=newaddress;
Customerid=newid;
Phonenumber=newphonenumber;
Emailaddress=newemailaddress;
System.out.println("customer's Profile");
System.out.println("Name: "+name+ "\nCustomer ID: "+customerid+"\nAddress:"+address+"\nPhone Number: "+phonenumber+"\nE-mail address: "+emailaddress);
}
}
Catalog Class
public class Customer
{
private int CustomerID;
private String Name;
private String Address;
private int Phonenumber;
private String Emailaddress;
//constructor
public Customer()
{
}
public Customer(int c, String n, String a, int p, String e)
{
CustomerID=c;
Name=n;
Address=a;
Phonenumber=p;
Emailaddress=e;
}
//methods
public void customergreetings(String newname)
{
Name=newname;
System.out.println(" Welcome to Direct Clothing" "+name+");
}
public void customerprofile(String newname, int newid, String newaddress, int newphonenumber, String newemailaddress)
{
Name=newname;
Address=newaddress;
Customerid=newid;
Phonenumber=newphonenumber;
Emailaddress=newemailaddress;
System.out.println("customer's Profile");
System.out.println("Name: "+name+ "\nCustomer ID: "+customerid+"\nAddress:"+address+"\nPhone Number: "+phonenumber+"\nE-mail address: "+emailaddress);
}
}
Order class
public class Order
{
//variable
private int orderID;
private double totalprice;
private String status;
//constuctor
public Order()
{
}
public Order(int orderID, double totalprice, String status)
{
}
//method
public void placeorder(int neworder, double newtotalprice, String newstatus)
{
orderid=neworder;
totalprice=newtotalprice;
status=newstatus;
}
public void removeorder(int order)
{
orderid=order;
System.out.println("Order number "+orderID+" has been remove");
}
public void submitorder()
{
System.out.println("Order number has been added "+orderid);
}
public void putorderonhold()
{
}
}
Order form class
public class FormofPayment
{
//variable declaration...
private int checknumber;
private int creditcardnumber;
private String expirationdate;
// constructor
public Formofpayment()
{
}
public FormofPayment(int c, int ccn, String e)
{
checknumber=c;
creditcardnumber=ccn;
expirationdate=e;
}
public void verifycreditcard()
{
System.out.println("Credit accepted!.");
}
public void verifycheckpayment()
{
System.out.println("pleasse verify your payment please");
}
}
Wednesday, February 4, 2009
CUBE
date started:February 4,2009
date ended:February 4,2009
Programm name:Cube
Programm purpose:to learned more about visibility modifier
*/
public class Cube{
private double width;
private double length;
private double height;
private double volume;
private double area;
public Cube(double w,double h,double l)
{
width=w;
height=h;
length=l;
}
public Cube()
{
}
private double volume()
{
return(width*length*height);
}
private double area()
{
return (width*length);
}
public void Dimension(double nLength, double nHeight, double nWidth)
{
length=nLength;
width=nWidth;
height=nHeight;
}
public void displayCube()
{
System.out.println("The volume of the Cube:"+volume());
System.out.println("the area of the Cube:"+area());
}
}
CUBETESTER
/*programmer: Pacalioga, Mark Jay
date started:February 4,2009
date ended:February 4,2009
Programm name:Cube
Programm purpose:to learned more about visibility modifier
*/
import java.util.Scanner;
class CubeTester
{
public static void main(String args[])
{
double l;
double w;
double h;
System.out.println("the cube with a parameter");
Cube newCube=new Cube(1,2,3);;
newCube.displayCube();
Scanner a=new Scanner(System.in);
System.out.println("Enter the value of the length:");
l=a.nextDouble();
Scanner b=new Scanner(System.in);
System.out.println("enter the value of the height:");
w=b.nextDouble();
Scanner c=new Scanner(System.in);
System.out.println("enter the value of the Width:");
h=c.nextDouble();
System.out.println("the Cube object without a parameter");
Cube secondCube=new Cube();
secondCube.Dimension(l,w,h);
secondCube.displayCube();
}
}