Answer to Question #253007 in Java | JSP | JSF for NUCHO

Question #253007

Create a java program that initialize a two dimensional array with the continuous assessment marks used to determine the semester mark for PRG510S exam qualification, The system should also create an array of student names in correspondence to the marks (Note: the appropriate weights of each individual assessment are given under corresponding headings and both the marks and student names are read from the user input)

Output1: Student Semester mark Qualifies for Exam? --------- ------------------- ----------------------- John 66 YES Harry 50 YES Uushona 38 NO Sililo 30 NO Qualifying mark is 50 and above.


1
Expert's answer
2021-10-19T16:20:00-0400
import java.io.*;
import java.util.*;
class Student
{
   Scanner input=new Scanner(System.in);
   String name;
   int marks[];
   Student()
   {
      System.out.print("Enter Student Name: ");
      name=input.next();;
      getMarks();
   }
   public void getMarks()
   {
       marks=new int[1];
       System.out.print("Enter "+name+"'s"+" Semester marks: ");
       marks[0]=input.nextInt();
       System.out.println(name+": "+"\n"+marks[0]);
       System.out.println("Student Semester mark Qualifies for Exam?");
       if(marks[0]>50){
           System.out.println(name+" "+marks[0]+" "+"Yes");
       }
       else{
           System.out.println(name+" "+marks[0]+" "+"No");
       }
   }
   
}
class Main
{
    public static void main(String args[])
    {
       System.out.println("Enter the number of students: ");
       Scanner input=new Scanner(System.in);
       int x=input.nextInt();
        Student s[]=new Student[x];
        for(int m=0;m<x;m++)
              s[m]=new Student();
     }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS