package june13;
import java.util.Scanner;
public class student {
int roll;
String name;
String email;
int hindi,english,physics,chemistry,maths;
void input_details(){
System.out.println("please enter the following details ");
Scanner sc= new Scanner(System.in);
System.out.println("enter the roll number ");
roll=sc.nextInt();
System.out.println("enter the name of student ");
name=sc.next();
System.out.println(" enter the email");
email=sc.next();
System.out.println(" enter the marks of hindi ");
hindi=sc.nextInt();
System.out.println("enter the marks of english ");
english=sc.nextInt();
System.out.println(" enter the marks of physics ");;
physics=sc.nextInt();
System.out.println(" enter the marks of chemistry ");
chemistry=sc.nextInt();
System.out.println("enter the marks of maths ");
maths=sc.nextInt();
}
void show_reportcard(){
System.out.println("\n\t\t\t***YOUR REPORT CARD****");
System.out.println("Rollnumber:\t"+roll);
System.out.println("Name:\t"+name);
System.out.println("Email:\t"+email);
System.out.println("Hindi:\t\t"+hindi);
System.out.println("English:\t"+english);
System.out.println("Physics:\t"+physics);
System.out.println("Chemistry:\t"+chemistry);
System.out.println("Maths:\t\t"+maths );
int total;
total=hindi+english+chemistry+physics+maths;
System.out.println("Total marks=\t"+total+"/500");
float avg;
avg=(total/500f)*100;
System.out.println("Average marks: \t"+avg);
if(avg<33)
{
System.out.println(" REMARKS \tFAIL\ndo hard work");
}
while((avg>34)&&(avg<44))
{
System.out.println("REMARK\t Third\naverage");break;
}
while((avg>45)&&(avg<59))
{
System.out.println("REMARK\t Second\ngood");break;
}
while((avg>60)&&(avg<74))
{
System.out.println("REMARK\t First\nvery good");break;
}
while(avg>=75)
{System.out.println("REMARK \t DISTINTION\nexcillent");break;
}
}
public static void main(String[] args) {
student s = new student ();
s.input_details();
s.show_reportcard();
}
}
import java.util.Scanner;
public class student {
int roll;
String name;
String email;
int hindi,english,physics,chemistry,maths;
void input_details(){
System.out.println("please enter the following details ");
Scanner sc= new Scanner(System.in);
System.out.println("enter the roll number ");
roll=sc.nextInt();
System.out.println("enter the name of student ");
name=sc.next();
System.out.println(" enter the email");
email=sc.next();
System.out.println(" enter the marks of hindi ");
hindi=sc.nextInt();
System.out.println("enter the marks of english ");
english=sc.nextInt();
System.out.println(" enter the marks of physics ");;
physics=sc.nextInt();
System.out.println(" enter the marks of chemistry ");
chemistry=sc.nextInt();
System.out.println("enter the marks of maths ");
maths=sc.nextInt();
}
void show_reportcard(){
System.out.println("\n\t\t\t***YOUR REPORT CARD****");
System.out.println("Rollnumber:\t"+roll);
System.out.println("Name:\t"+name);
System.out.println("Email:\t"+email);
System.out.println("Hindi:\t\t"+hindi);
System.out.println("English:\t"+english);
System.out.println("Physics:\t"+physics);
System.out.println("Chemistry:\t"+chemistry);
System.out.println("Maths:\t\t"+maths );
int total;
total=hindi+english+chemistry+physics+maths;
System.out.println("Total marks=\t"+total+"/500");
float avg;
avg=(total/500f)*100;
System.out.println("Average marks: \t"+avg);
if(avg<33)
{
System.out.println(" REMARKS \tFAIL\ndo hard work");
}
while((avg>34)&&(avg<44))
{
System.out.println("REMARK\t Third\naverage");break;
}
while((avg>45)&&(avg<59))
{
System.out.println("REMARK\t Second\ngood");break;
}
while((avg>60)&&(avg<74))
{
System.out.println("REMARK\t First\nvery good");break;
}
while(avg>=75)
{System.out.println("REMARK \t DISTINTION\nexcillent");break;
}
}
public static void main(String[] args) {
student s = new student ();
s.input_details();
s.show_reportcard();
}
}
This comment has been removed by the author.
ReplyDelete