Main Class
Main Class
*;
class Publication {
String Title;
double Price;
int Copies;
/*Publication(){
Title=null;
Price=0.0;
Copies=0;
}*/
public int setcopies(int c) {
this.Copies = this.Copies-c;
return this.Copies;
}
public void setPrice(int c){
double TotalPrice=this.Price*c;
}
public void saleCopy(double totalPrice){
System.out.println("Total Publication sell: " + totalPrice);
}
}
flag=1;
break;
}
else
System.out.println(" Sorry Not sufficient Copies");
}
else
{
flag=0;
}
}
if (flag==0){
System.out.println("Book not Found");
}
System.out.println("Do you want to order more books? \n 1: Yes 2: No ");
ch=scr.nextInt();
}while(ch==1);
return totalPrice;
}
public void saleCopy(double totalPrice) {
System.out.println("Total Books sell: " +totalPrice );
}
}