Input the Student Indexno,Name,subjects in java
Please select one option
import java.util.Scanner; public class Student { public void Main(String args[]) { Scanner scan = new Scanner(System.in); System.out.print("Enter Student Index No : "); String IndexNo = scan.next(); System.out.print("Enter Student Name : "); String name = scan.next(); System.out.print("Enter Number of Subjects : "); int number_of_subjects = scan.nextInt(); System.out.println(); int marks = 0; int max = 0; int tot = 0; for (int a = 0; a < number_of_subjects; a++) { System.out.print("Enter Subject " + (a + 1) + " Marks : "); marks = scan.nextInt(); if (max < marks) { max = marks; } tot = tot + marks; } boolean b = true; while (b) { System.out.println(); System.out.println("A. Display Student Details."); System.out.println("B. Display Maximum Marks."); System.out.println("C. Display Total, Average & Result."); System.out.println("X. Exit."); System.out.println(); System.out.print("select one option Here : "); String option = scan.next(); System.out.println(); switch (option) { case "A": System.out.println("Student IndexNo : " + IndexNo); System.out.println("Student Name : " + name); break; case "B": System.out.println("Maximum Marks : " + max); break; case "C": double avg = tot / (double) number_of_subjects; String grade = "Fail"; if (avg >= 50) { grade = "Pass"; } System.out.println("Your Total : " + tot); System.out.println(" Your Average : " + avg); System.out.println("Your Grade : " + grade); break; case "X": System.out.println("Exit"); b = false; break; default: System.out.println("Please select valid option."); } } } }
Have you ever wanted to talk to a friendly, smart robot that helps you with…
DeepSeek AI is becoming a friendly and powerful new tool in the world of artificial…
Do you want to become an expert in Spring Boot CRUD operations? This comprehensive tutorial…
Modern websites must have a navigation bar that is clear and responsive. FlexBox CSS is…
Introduction In this section, we will guide you step by step in the development of an image upload registration system in Java using MySQL and JDBC. In the application, users register…
The Touchable Shop POS (Point of Sale) system is a sophisticated software solution developed using…