Professional Documents
Culture Documents
02 235202 047 8211184758 06062021 082750pm
02 235202 047 8211184758 06062021 082750pm
//goldcustomer
/*
*/
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali
En: 02-235202-047
package testcustomer;
if(super.bill_amount>=20000 ){
else{
updatedpoints=100-super.pointsofloyality;
updatedpoints=super.pointsofloyality-200;
@Override
super.discount=super.bill_amount*0.15;
super.pointsdiscount=super.bill_amount*0.05;
super.pointsdiscount=super.bill_amount*0.08;
}
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali
En: 02-235202-047
super.finaldiscount=super.pointsdiscount+super.discount;
super.totalbill=super.bill_amount - super.finaldiscount;
:"+super.discount );
@Override public
void ToString()
System.out.println("discount is : "+finaldiscount);
//silver
/*
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali
En: 02-235202-047
*/
package testcustomer;
}
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali
En: 02-235202-047
super.discount=super.bill_amount*0.08;
super.pointsdiscount=super.bill_amount*0.05;
super.pointsdiscount=super.bill_amount*0.08;
super.finaldiscount=super.pointsdiscount+super.discount;
totalbill=bill_amount-discount;
updatedpoints=super.pointsofloyality-100;
updatedpoints=super.pointsofloyality-200;
}
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali
En: 02-235202-047
@Override public
void ToString()
System.out.println("discount is : "+finaldiscount);
void checkcustomer() {
if(super.bill_amount>=20000 ){
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali
En: 02-235202-047
else{
}
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali
En: 02-235202-047
//general
/*
*/
package testcustomer;
if(super.bill_amount>=20000 ){
else{
}
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali
En: 02-235202-047
@Override public
void get_bill(){
@Override public
void ToString()
//customer
/*
*/
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali
En: 02-235202-047
package testcustomer;
finaldiscount;
this.cust_name=cust_name;
this.cust_Address=cust_Address;
this.cust_phone=cust_phone; this.bill_amount=bill_amount;
setName(String name)
cust_name=name;
return cust_name;
{
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali
En: 02-235202-047
cust_Address=Address;
return cust_Address;
cust_phone=phone;
return cust_phone;
{
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali
En: 02-235202-047
bill=bill_amount;
return bill_amount;
pointsofloyality=points_of_loyality;
return pointsofloyality;
}
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali
En: 02-235202-047
pointsdiscount=bill_amount*0.05;
pointsdiscount=bill_amount*0.08;
finaldiscount=pointsdiscount+discount;
totalbill=bill_amount - finaldiscount;
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali
En: 02-235202-047
System.out.println("discount is : "+finaldiscount);
//testcustomer package
testcustomer;
import java.util.Scanner;
Goldcustomer[] cutomerList;
cutomerList[0] = new
Goldcustomer("basharat","laandhi",90367867,260000,132);
cutomerList[0].checkcustomer();
cutomerList[0].get_bill(); cutomerList[0].updatepoints();
cutomerList[0].ToString();
System.out.println();
cutomerList[1] = new
Goldcustomer("Ali","ptharrod",067577,25000,135);
cutomerList[1].checkcustomer(); cutomerList[1].get_bill();
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali
En: 02-235202-047
cutomerList[1].updatepoints(); cutomerList[1].ToString();
System.out.println();
cutomerList[2] = new
Goldcustomer("akbar","latifabad",7098766,20000,175);
cutomerList[2].checkcustomer(); cutomerList[2].get_bill();
cutomerList[2].updatepoints(); cutomerList[2].ToString();
System.out.println();
silvercustomer[] silvercutomerList;
silvercutomerList[0] = new
silvercustomer("asif","greentown",7035287,15000,198);
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali
En: 02-235202-047
silvercutomerList[0].checkcustomer();
silvercutomerList[0].get_bill();
silvercutomerList[0].updatepoints();
silvercutomerList[0].ToString();
System.out.println();
silvercutomerList[1] = new
silvercustomer("abid","johar",03524567,16000,165);
silvercutomerList[1].checkcustomer();
silvercutomerList[1].get_bill();
silvercutomerList[1].updatepoints();
silvercutomerList[1].ToString();
System.out.println();
silvercutomerList[2] = new
silvercustomer("noor","johar",803524567,18000,110);
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali
En: 02-235202-047
silvercutomerList[2].checkcustomer();
silvercutomerList[2].get_bill();
silvercutomerList[2].updatepoints();
silvercutomerList[2].ToString();
System.out.println();
Customer[] customerList;
customerList[0] = new
Customer("asim","joharmor",60357869,27000,134);
customerList[0].get_bill();
customerList[0].ToString();
System.out.println();
customerList[1] = new
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali
En: 02-235202-047
Customer("asad","digroad",80765,21000,171);
customerList[1].get_bill();
customerList[1].ToString(); System.out.println();
generalcustomer[] generalcustomerList;
generalcustomerList[0] = new
generalcustomer("hadi","bahriatown",403746567,700,182);
generalcustomerList[0].get_bill();
generalcustomerList[0].ToString();
System.out.println();
generalcustomerList[1] = new
generalcustomer("rajab","haris",03524567,700,180);
generalcustomerList[1].get_bill();
generalcustomerList[1].ToString();
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali
En: 02-235202-047
System.out.println();
}
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali
En: 02-235202-047
output
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali En:
02-235202-047
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali En:
02-235202-047
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali En:
02-235202-047
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali En:
02-235202-047
CSL-113: Object Oriented Programming
Semester –BS IT – 02-A
Name: Basharat Ali En:
02-235202-047