Computer Science, asked by rockbottom619rip, 11 months ago

Debug the following java program:
import java.io.*;
class Fruitjuice
{
int product_code,pack_size,product_price;
String flavour,pack_type;
Fruitjuice()
{
product_code=0;
pack_size=0;
product_price=0;
flavour=" ";
pack_type=" ";
}
void input()throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the product code,flavour,pack type,pack size and product code respectively");
product_code=Integer.parseInt(br.readLine());
flavour=br.readLine();
pack_type=br.readLine();
pack_size=Integer.parseInt(br.readLine());
product_price=Integer.parseInt(br.readLine());
}
void discount()
{
product_price=product_price-10;
}
void display()
{
System.out.println("Product code: "+product_code);
System.out.println("Flavour: "+flavour);
System.out.println("Pack type: "+pack_type);
System.out.println("Pack size: "+pack_size+" ml");
System.out.println("Product price is:Rs "+product_price);
}
}


Anonymous: like seriously? o. O wut is this sorcery?!
rockbottom619rip: Dats Java thingy
rockbottom619rip: Constructor is really eating my head off.
Anonymous: :/ #poor soul xD xD
rockbottom619rip: :(((
Anonymous: we don't have computers as a sub in 10th ;)

Answers

Answered by anupama777vidya
2

Answer:

The program is perfect.

There are no errors.

Any other help??

Answered by Messi106974
1

Answer:

You have written "throws IO Exception without any backslash... which will raise error in compilation..

Please mark Brainliest

Similar questions