Assignment oop2
Assignment oop2
*;
class Publication
{
String title=null;
float price=0;
int copy=0;
void get()
{
Scanner sc=new Scanner(System.in);
void display()
{
System.out.println("The title is: "+title);
System.out.println("The price is: "+price);
System.out.println("Number of copies are: "+copy);
}
void sale()
{
float tot;
int x;
int z;
Scanner sc=new Scanner(System.in);
System.out.println("Enter the number of copies sold: ");
x=sc.nextInt();
tot=price*x;
z=copy-x;
System.out.println("The sale is: "+tot);
System.out.println("Available copies are: "+z);
}
}
void books()
{
Scanner sc=new Scanner(System.in);
void magazines()
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter the number of copies sold: ");
ordqty=sc.nextInt();
}
void issue()
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter the date to be displayed in manner:
day/month/year");
currentissue=sc.nextLine();
System.out.println("The issue date of magazine is: ");
System.out.println(currentissue);
}
}
case 2:
System.out.println("Magazine Operation");
Magazine m1 = new Magazine();
m1.get();
m1.magazines();
m1.display();
m1.sale();
m1.issue();
break;
case 3:
System.out.println("Thank you");
System.exit(0);
break;
default:
System.out.println("Enter proper choice: ");
}
}
}
}