Sunday, February 8, 2009
IT134_Direct Clothing Case Study
Program Name: Direct Clothing Case Study (Catalog)
Date Started: 02-07-2009
Date Finished: 02-08-2009
Program PUrpose: to be able to make the case study solution for direct clothing
*/
public class Catalog
{
//variable declaration
private int shirtid;
private double price;
private String color;
private String description;
private int quantityinstock;
//costructor declaration
public Catalog()
{
}
public Catalog(int s, double p, String c, String d, int q)
{
shirtid=s;
price=p;
color=c;
description=d;
quantityinstock=q;
}
//method declaration
public void addashirt(int newshirtid, double newprice, String newcolor, String
newdescription, int newquantityinstock)
{
shirtid=newshirtid;
price=newprice;
color=newcolor;
description=newdescription;
quantityinstock=newquantityinstock;
System.out.println("Shirt number: "+shirtid+ "\nPrice: "+price+"\nColor: "+color+"\nDescription: "+description+"\nQuantity in Stock: "+quantityinstock);
}
public void removeashirt(int newshirtid)
{
shirtid=newshirtid;
System.out.println("The Shirt number "+shirtid+" is succesfully remove from the order");
}
}
******************************************************************************
/*Programmer Name: Gezelle Re-ann B. Mandabon
Program Name: Direct Clothing Case Study (Customer)
Date Started: 02-07-2009
Date Finished: 02-08-2009
Program PUrpose: to be able to make the case study solution for direct clothing
*/
public class Customer
{
//variable declaration
private int customerid;
private String name;
private String address;
private int phonenumber;
private String emailaddress;
//constructor declaration
public Customer()
{
}
public Customer(int c, String n, String a, int p, String e)
{
customerid=c;
name=n;
address=a;
phonenumber=p;
emailaddress=e;
}
//method declarations
public void customergreetings(String newname)
{
name=newname;
System.out.println("Hi! "+name+" Welcome to DIRECT CLOTHING");
}
public void customerprofile(int newid, String newname, String newaddress, int newphonenumber, String newemailaddress);
{
customerid=newid;
name=newname;
address=newaddress;
phonenumber=newphonenumber;
emailaddress=newemailaddress;
System.out.println("customer's Profile");
System.out.println("Customer ID: "+customerid+"\nName: "+Name+"\nAddress: "+address+"\nPhone Number: "+phonenumber+"\nE-mail address: "+emailaddress);
}
}
**********************************************************************************
/*Programmer Name: Gezelle Re-ann B. Mandabon
Program Name: Direct Clothing Case Study (Order)
Date Started: 02-07-2009
Date Finished: 02-08-2009
Program PUrpose: to be able to make the case study solution for direct clothing
*/
public class Order
{
//variable declaration
private int orderid;
private double totalprice;
private String status;
//constuctor declaration
public Order()
{
}
public Order(int o, double t, String s)
{
orderid=o;
totalprice=t;
status=s;
}
//method declaration
public void placeorder(int newo, double newt, String news)
{
orderid=newo;
totalprice=newt;
status=news;
}
public void removeorder(int o)
{
orderid=o;
System.out.println("Order number "+orderid+" is succesfully canceled");
}
public void submitorder()
{
System.out.println("You have submitted successfully the order number "+orderid);
}
public void putorderonhold()
{
System.out.println("The order is proccess by the company.\nJust wait for he reply.");
}
}
*********************************************************************************
/*Programmer Name: Gezelle Re-ann B. Mandabon
Program Name: Direct Clothing Case Study (Shirt)
Date Started: 02-07-2009
Date Finished: 02-08-2009
Program PUrpose: to be able to make the case study solution for direct clothing
*/
public class Shirt
{
//variable declaration
private int shirtid;
private double price;
private String color;
private String description;
private int quantityinstock;
//constructor declaration
public Shirt()
{
}
public Shirt(int s, double p, String c, String d, int q)
{
shirtid=s;
price=p;
color=c;
description=d;
quantityinstock=q;
}
//method declaration
public void addshirttoorder(int newshirtid)
{
shirtid=newshirtid;
System.out.println("You've added the Shirt number "+shirtid+" to your orders");
}
public void removeshirttoorder(int newshirtid)
{
shirtid=newshirtid;
System.out.println("Shirt number " +shirtid+ "is remove successfully from the orders");
}
public void displayshirtinformation()
{
System.out.println("Shirt number: "+shirtid+ "\nPrice: "+price+"\nColor: "+color+"\nDescription: "+description+"\nQuantity in Stock: "+quantityinstock);
}
public void addstock(int newshirtid, double newprice, String newcolor, String newdescription, int newquantityinstock)
{
shirtid=newshirtid;
price=newprice;
color=newcolor;
description=newdescription;
quantityinstock=newquantityinstock;
System.out.println("Shirt number: "+shirtid+ "\nPrice: "+price+"\nColor: "+color+"\nDescription: "+description+"\nQuantity in Stock: "+quantityinstock);
}
public void removestock(int newshirtid)
{
shirtid=newshirtid;
System.out.println("The Shirt number "+shirtid+" is succesfully remove from the stock");
}
}
********************************************************************************
/*Programmer Name: Gezelle Re-ann B. Mandabon
Program Name: Direct Clothing Case Study (Form of Payment)
Date Started: 02-07-2009
Date Finished: 02-08-2009
Program PUrpose: to be able to make the case study solution for direct clothing
*/
public class Formofpayment
{
//variable declaration
private int checknumber;
private int creditcardnumber;
private String expirationdate;
//constructor declaration
public Formofpayment()
{
}
public Formofpayment(int c, int cc, String e)
{
checknumber=c;
creditcardnumber=cc;
expirationdate=e;
}
public void verifycreditcard()
{
System.out.println("Your credit card is OK, we will deduct your transaction from your credit dard.");
}
public void verifycheckpayment()
{
System.out.println("OK!!!You must send first your Check in the company before we Send to you your orders!");
}
}
********************************************************************************
/*Programmer Name: Gezelle Re-ann B. Mandabon
Program Name: Direct Clothing Case Study (Direct Clothing Tester)
Date Started: 02-07-2009
Date Finished: 02-08-2009
Program PUrpose: to be able to make the case study solution for direct clothing
*/
import java.util.*;
public class DirectClothingTester
{
public static void main(String args[])
{
String name;
int customerid;
String address;
int phonenumber;
String emailaddress;
int cq1;
int cq2;
int shirtid;
double price;
String color;
String description;
int quantity;
int payment;
int ordernumber;
System.out.println("WELCOME TO DIRECT CLOTHING CASE STUDY");
System.out.println("\n");
System.out.println("The Shirt in the direct clothing that is currently available is/are:");
System.out.println("\n");
Scanner z=new Scanner(System.in);
System.out.println("If you want to add another stock just press:");
System.out.println("Y if yes!, Z if no!");
cq1=z.nextInt();
if(cq1==1)
{
Scanner y=new Scanner(System.in);
System.out.println("Enter the following information:");
System.out.println("Shirt ID:");
Shirtid=y.nextInt();
Scanner x=new Scanner(System.in);
System.out.println("Price:");
price=x.nextDouble();
Scanner w=new Scanner(System.in);
System.out.println("Color:");
color=w.nextLine();
Scanner v=new Scanner(System.in);
System.out.println("Description:");
description=v.nextLine();
Scanner u=new Scanner(System.in);
System.out.println("Quantity:");
quantity=u.nextInt();
Shirt shirt2=new Shirt();
Shirt2.addstock(shirtid, price, color, description, quantity);
Shirt1.displayshirtinformation();
System.out.println("\n");
Shirt2.displayshirtinformation();
}
else
{
System.out.println("OKIE");
}
System.out.println("\n");
Scanner t=new Scanner(System.in);
System.out.println("If you want to remove a stock just press:");
System.out.println("Y if yes, Z if no!");
cq2=t.nextInt();
if(cq2==1)
{
Scanner s=new Scanner(System.in);
System.out.println("Please enter the Shirt ID number:");
System.out.println("REMINDER:just enter the shirt id number 1 if it is only the available");
shirtid=s.nextInt();
shirt1.removestock(shirtid);
}
}
}
******************************NOTHING FOLLOWS*******************************
Wednesday, February 4, 2009
IT134A_DDS
/*Date started: 02-04-2009
/*Date ended: 02-04-2009
/*Program name: Cube
/*Program purpose: To create classes using Visibility Modifiers.
public class Cube
{
private double length;
private double width;
private double height;
private double volume;
private double area;
public Cube(double l, double w, double h)
{
l=length;
w=width;
h=height;
}
public Cube()
{
}
private double volume()
{
return (length*width*height);
}
private double area()
{
return (length*width);
}
public void setDimension(double newLength, double newwidth, double newheight)
{
length=newLength;
width=newWidth;
height=newHeight;
}
public void displayCube()
{
System.out.println("Cube Dimensions");
System.out.println("The VOLUME of the Cube is" +volume());
System.out.println("The AREA of the Cube is" +area());
}
}
***************************************************************************
/*Programmer: Gezelle Re-ann B. Mandabon
/*Date started: 02-04-2009
/*Date ended: 02-04-2009
/*Program name: CubeTester
/*Program purpose: To create classes using Visibility Modifiers.
import java.util.Scanner;
class CubeTester
{
public static void main(String args[])
{
double l;
double w;
double h;
System.out.println("\n\n");
System.out.println("The Cube object with a parameter");
Cube firstCube=new Cube(2,2,2);
firstCube.displayCube();
System.out.println("The Cube object without a parameter");
System.out.println("\n\n");
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");
System.out.println("\n\n");
Cube secondCube=new Cube();
secondCube.setDimension(l,w,h);
secondCube.displayCube();
}
}
************************nothing follows***************************