Plz point out my mistake in the prog.:
import java.io.*;
class FruitJuice
{
int product_code,pack_size,product_price;
String flavour,pac_type;
FruitJuice()
{
product_code=0;
pack_size=0;
product_price=0;
flavour="";
pac_type="";
}
void input()throws IOException
{
BufferedReader inp=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter pcode psize pprice flavour pactype");
product_code=Integer.parseInt(inp.readLine());
pack_size=Integer.parseInt(inp.readLine());
product_price=Integer.parseInt(inp.readLine());
flavour=inp.readLine();
pac_type=inp.readLine();
}
void discount()
{
product_price=product_price-10;
}
void display()
{
System.out.println("P code="+product_code);
System.out.println("P size="+pack_size);
System.out.println("P price="+product_price);
System.out.println("Flavour="+flavour);
System.out.println("P type="+pac_type);
}
public static void main(String args[])
{
FruitJuice ob=new FruitJuice();
ob.input();
ob.discount();
ob.display();
}
} |
|
| asked by Aavesh Kumar (aavesh) 9 years ago | |
1 | |
The function of try block and catch block Please answer fast |
|
| asked by Ankit kumar (yobro99) 9 years ago | |
1 | |
Are double dimension arrays in scope? |
|
| asked by Abhishek Agrawal (agrek) 9 years ago | |
1 | |
GUYS WHAT PLANS FOR TOMORROW???😜😜😜 |
|
| asked by Sidra Haider (sidrahaider) 9 years ago | |
2 | |
Say what you want but to me, Watson is one of a kind. He is the best there was, the best there is and the best there will ever be |
|
| asked by Saahil Sankar B (bestintheworld) 9 years ago | |
1 | |
