Blogger

Delete comment from: Java67

Anonymous said...

import java .util.*;
class Student
{
public static void main(String args[])
{
Scanner sc =new Scanner(System.in);
int age;
String name;
double m1,m2,m3,avg,max;
{
Name=name;
Age=age;
m1=x;
m2=y;
m3=z;
}
void accept()
{
Scanner sc=new Scanner (Syetem.in);
System.out.println("Enter name,age,m1,m2,m3");
name =sc.next();
age =sc.nextInt();
m1 =sc.nextDouble();
m2 =sc.nextDouble();
m3 =sc.nextDouble();
}
void compute()
{
if(m1>m2&&m1>m3)
{
max =m1;
}
else if(m2>m1&&m2>m3)
{
max =m2;
}
else
{
max=m3;
}
avg =(m1+m2+m3)
}
void display()
{
Sytem.out.println("Name ="+name);
System.out.println("Age ="+age);
System.out.println("m1 ="+m1);
System.out.println("m2 ="+m2);
System.out.println("m3 ="+m3);
System.out.println("Max marks ="+max);
System.out.println("Average ="+avg);
}
public static void main(String args[])
{
student ob =new student("Jack,10,45,43,49)
ob.accept();
ob.compute();
ob.display();
}
}
}
what is the problem in this sum

Oct 6, 2020, 12:09:35 PM


Posted to How to fix "illegal start of expression" error in Java? Example

Google apps
Main menu