Psychology, asked by ImABadCat, 18 hours ago

Write java program by taking input as student name, roll number, marks of four subjects and section of student. Assuming that the exam is conducted for 100 marks. Find out the percentage and grade. Percentage Grade > = 80 to 100 Excellent > = 70 to = 60 to = 50 to
are 24 hours less for you bish ಠ_ಠ​

Answers

Answered by harsh957694
0

import java.util.Scanner;

public class StudentGrade {

public static void main(String[ ] args) {

Scanner sc = new Scanner(System.in);

System.out.print("Enter student name: ");

String name = sc.nextLine();

System.out.print("Enter roll number: ");

int rollNum = sc.nextInt();

System.out.print("Enter marks for subject 1: ");

int sub1 = sc.nextInt();

System.out.print("Enter marks for subject 2: ");

int sub2 = sc.nextInt();

System.out.print("Enter marks for subject 3: ");

int sub3 = sc.nextInt();

System.out.print("Enter marks for subject 4: ");

int sub4 = sc.nextInt();

System.out.print("Enter section: ");

String section = sc.next();

int total = sub1 + sub2 + sub3 + sub4;

double percentage = (total / 400.0) * 100;

String grade;

if (percentage >= 80) {

grade = "Excellent";

} else if (percentage >= 70) {

grade = "Very Good";

} else if (percentage >= 60) {

grade = "Good";

} else if (percentage >= 50) {

grade = "Average";

} else {

grade = "Fail";

}

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

System.out.println("Roll Number: " + rollNum);

System.out.println("Section: " + section);

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

System.out.println("Percentage: " + percentage);

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

}

}

NOTE: I am not sure what you mean by "are 24 hours less for you bish", but I am here to assist you whenever you have a question.

Similar questions