Computer Science, asked by abhijit4769, 6 months ago

Write a java program to display a report card

Answers

Answered by ItzWanderousGirl
6

Answer:

To understand a programming language you must practice the programs, this way you can learn the language faster. This page includes java programs on various java topics such as control statements, loops, classes & objects, functions, arrays etc. All the programs are tested and provided with the output. If you new to java and want to learn java

Explanation:

hope it's helpful ☺️

mark me brainlist ❣️

Answered by harshit123396
1

Explanation:

import java.util.*;

class Student

{

int rollno,physics,chem,math;

String name,email;

public static void main(String...args)

{

Student s1=new Student();

Scanner sc=new Scanner(System.in);

System.out.print("Roll no. : ");

s1.rollno=sc.nextInt();

System.out.print("Name : ");

s1.name=sc.next();

System.out.print("Email : ");

s1.email=sc.next();

System.out.println("Enter the Marks following...");

System.out.print("Physics : ");

s1.physics=sc.nextInt();

System.out.print("Chemistry : ");

s1.chem=sc.nextInt();

System.out.print("Math : ");

s1.math=sc.nextInt();

int total=s1.physics+s1.chem+s1.math;

int avg=(total*100)/300;

String grade;

if(avg<33)

{

grade="Fail";

}

else if ( avg >=34 && avg <= 44 )

{

grade="III";

}

else if ( avg >= 45 && avg <= 59 )

{

grade="II";

}

else if ( avg >=60 && avg <= 74 )

{

grade="I";

}

else

{

grade="Distinction";

}

//Report card..

System.out.println("\n***Report Card***");

System.out.println("Roll no. : "+s1.rollno);

System.out.println("Name : "+s1.name);

System.out.println("Email : "+s1.email);

System.out.println("Physics : "+s1.physics);

System.out.println("Chemistry: "+s1.chem);

System.out.println("Math : "+s1.math);

System.out.println("Total : "+total);

System.out.println("Average : "+avg);

System.out.println("Grade : "+grade);

}

}

I only wrote for you

I only wrote for you Pls Mark me as branliest

I only wrote for you Pls Mark me as branliest And pls follow me

Similar questions