You are on page 1of 3

import java.util.

Scanner;

public class newJavaFile {

public static void main(String[] args)throws Exception {

Scanner input1 = new Scanner(System.in).useDelimiter("\n");;

Scanner input2 = new Scanner(System.in).useDelimiter("\n");;

Scanner input3 = new Scanner(System.in).useDelimiter("\n");;

Scanner input4 = new Scanner (System.in).useDelimiter("\n");;

char choice;

int count;

System.out.println(" PHILIPPINE SCIENCE HIGH-SCHOOL REGISTRATION SYSTEM");

do{

System.out.println("How many students do you want to register?");

count = input2.nextInt();

String[]studentName1=new String[count];

long []studentNumber1=new long[count];

int[]studentAge1=new int[count];

String[]studentGender1=new String[count];

String[]studentAddress1=new String[count];

for(int i = 0; i<count; i++){

System.out.println("Profile "+(i+1));

System.out.print("");

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

studentName1[i]=input1.next();

System.out.print("Student Number:");
Scanner b = new Scanner(System.in);

studentNumber1[i]=input2.nextInt();

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

Scanner c = new Scanner(System.in);

studentAge1[i]=input2.nextInt();

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

Scanner d = new Scanner(System.in);

studentGender1[i]=input2.next();

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

Scanner e = new Scanner(System.in);

studentAddress1[i]=input4.nextLine();

System.out.println(" ");

System.out.println("");

for(int i = 0; i<count; i++){

System.out.println("Profile "+(i+1));

System.out.println("Student Name: " + studentName1[i]);

System.out.println("Student Numebr: "+ studentNumber1[i]);

System.out.println("Age: " + studentAge1[i]);

System.out.println("Gender: "+ studentGender1[i]);

System.out.println("Address: "+ studentAddress1[i]);

System.out.println("");

if (count==1){
System.out.println("You have successfully registered ("+count+") student.");

}else if (count>1){

System.out.println("You have successfully registered ("+count+") students.");

System.out.println("Do you want to register more students? [Y/N] ");

choice = input3.nextLine().charAt(0);

}while(choice=='Y');

if(choice=='N'){

System.out.println("Program shutting down. Have a niceday :)");

You might also like