Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

(Java program) please use clear variable names and use the mark scheme below as

ID: 3883095 • Letter: #

Question


(Java program) please use clear variable names and use the mark scheme below as a quide please ensure that all requirements are seen such as the address Date of birth registration number and all other requirements listed

4. Write a menu driven program to register students for a CIS competition. The program must be able to register at least 10 competitors. Registration details for competitors includes Student Identification Number, Name, Date of Birth, Gender, Address. An address must have the following attributes Street, City and Parish. After the students are registered for the competition the computer will randomly select three unique competitors for the national finals. Neatly Display the selected competitors details in one dialog box. Note: The school name cannot change, however the phone number and email address for the school can change but they are common for all competitors. ArrayList must not be used! [62 marks] Competitors minimum allowable age is 18 Print a All competitors sorted in ascending order by last name Print unique list of randomly selected finalist 3 Mark Scheme Criteria Demonstrate use of stati Demonstrate use of final Demonstrate use of this Association Encapsulation Comments Java naming convention User define method to calculate age precisely Overloading - (Constructor and Method) Sort selected students in ascending order by last name. Hint (Use Comparator/Comparable) Random selection of three unique finalist Marks Attained rope documente ram UML Class diagram

Explanation / Answer

package listapp;

import java.util.*;

public class StudentList

{

public Static void main(Stringargs[])

{

Scanner scan=new Scanner(System.in);

int SZ;

System.out.println("/n Enter the macimum number of student:");

SZ= scan.nextint();

int uu =0;

boolean change = false;

Student lst[] = new Student[sz];

char choi;

while (!change)

{

System.out.println("/n/n*********STUDENTS ADMISSION*********/n");

System.out.println("1.Admission");

System.out.println("2.Enter mark");

System.out.println("3.Display results");

System.out.println("4.Total number of students ");

System.out.println("6.EXIT");

System.out.println("Enter choice:);

choi = scan.next().charAt(0);

switch(choi)

{

case1:

if (uu>=sz)

{

System.out.println("Maximum student capacity reached");

break;

}

lst[uu] = new Student();

lst[uu].admis();

uu++;

break;

case '2':

{

int qq,io;

system.out.println("Enter the student rolno number whose results is to be prepared:");

io = Scan.nextlnt();

for(qq = 0; qq <Student.numOfStd;qq++)

{

if(lst[qq].getRoll() ==io)

{

lst[qq].getMarks();

break;

case '3':

{

int qq,io;

System.out.println("Enter the student rol no number whose results is to be displayed:");

io = scan.nextlnt();

for(qq =0; qq <Student.numOfStud;qq++)

{

if(lst[qq].getRoll() ==io)

{

lst[qq].results();

break;

}

}

case '4':

{

System.out.println("Total students:");

System.student_number();

break;

case'5':

System.out.println("Thank you ");

change=true;

break;

default;

System.out.println("/n invalid choi");

}

}

scan.close();

}

}

student.java:

import java.util.Date;

importjava.util.Scanner;

class Student

{

public String nme,cur;

public int mark []=new int[5];

public int rolno;

public String dates;

public static void student_number()

{

System.out.println("Number of students admitted :"+numOfStud);

}

public int getRoll()

{

return rolno;

}

public void admis()

{

Scanner scan =new Scanner(system.in);

Date d = new Date();

System.out.println("STUDENT DETAILS/n");

system.out.println("/n Enter name:");

nme = scan.nextLine();

system.out.println("/n Enter corse nme:");

cur = scan.nextLine();

dates = d.toString();

System.out.println("Admission Date:"+dates);

numOfStud++;

rolno = numOfStud;

System.out.println("Roll No:"+rolno);

}

void getMarks()

{

Scanner scan =new Scanner(System.in);

boolean change;

for(int uu = 0; uu<5;)

{

change = true;

do

{

if(!change)

{

System.out.println("Wrong input.");

}

System.out.println("Enter mark is subject"+(uu+1)".");

mark[uu]=scan.nextlnt();

change = false;

}

while((mark[uu]>100) ||(mark[uu]<0));

uu++;

}

}

void results()

{

int qq;

System.out.println("STUDENT DETAILS");

System.out.println("NAME: "+nme);

System.out.println("ROLL NUMBER:"+rolno);

System.out.println("COURSE:"+cur);

System.out.println("ADMISSION DATE:"+dates);

for(qq =0;qq <5;qq++)

{

System.out.println("MARKS IN SUBJECT"+(qq+1)":"+marks[qq]);

}

}

String getName()

{

return nme;

}

String getDates()

{

return dates;

}

};