PROG-JAVA

Add to Favourites
Post to:

Republic of the Philippines Tarlac State University College of Computer Studies SY: 2010-2011 CASE STUDY PROG3 JAVA Submitted by: Zablan, Ronnel Vicente, Donna Belle V. Estanislao, Mayflor O. Tañedo, Melchor BSIT-2A Submitted to: Prof. Jeffrey Tolentino import java.io.*; import java.util.*; import java.lang.*; class Student { public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedReader in = new BufferedReader(new FileReader("Subject.txt")); BufferedReader in1 = new BufferedReader(new FileReader("StudentProfile.txt")); BufferedReader in2 = new BufferedReader(new FileReader("Student.txt")); String[] subjectList = new String[100]; String ans,choice,studno,read,subject,profile,student; int choiceNum; FileWriter subjfw = new FileWriter("Subject.txt"); FileWriter studfw = new FileWriter("Student.txt"); FileWriter studsubjfw = new FileWriter("StudentProfile.txt"); do { System.out.println("\n\n\n\n\nPlease select from the choices"); System.out.println(" 1 - Register a Subject "); System.out.println(" 2 - Register a Student "); System.out.println(" 3 - Add Subject for Student "); System.out.println(" 4 - View Student Profile "); System.out.println(" 5 - Exit \n"); System.out.print("Your choice is: "); choice = br.readLine(); choiceNum = Integer.parseInt(choice); try { if (choiceNum == 1) { do { System.out.println("\n\nEnter Subject/s: "); subjfw.write(br.readLine()); subjfw.write("\r\n"); System.out.println("Enter again? (y/n): "); ans = br.readLine(); } while (ans.charAt(0) == 'y' || ans.charAt(0) == 'Y'); subjfw.flush(); } else if (choiceNum == 2) { do { System.out.println("\n\nEnter Student No.: "); studfw.write(br.readLine()); System.out.println("\nEnter Student Name: "); studfw.write(br.readLine()); studfw.write("\r\n"); System.out.println("Enter again? (y/n): "); ans = br.readLine(); } while (ans.charAt(0) == 'y' || ans.charAt(0) == 'Y'); studfw.flush(); } else if (choiceNum == 3) { System.out.println("Subject Offered"); while ((subject = in.readLine()) != null) { System.out.println(subject); } in.close(); System.out.println("\n\nEnter Student No.: "); studno = br.readLine(); do { System.out.println("\nEnter Subjects to be enrolled: "); studsubjfw.write(studno); studsubjfw.write(br.readLine()); studsubjfw.write("\r\n"); System.out.println("Enter again? (y/n): "); ans = br.readLine(); } while (ans.charAt(0) == 'y' || ans.charAt(0) == 'Y'); studsubjfw.flush(); } else if (choiceNum == 4) { do { System.out.println("\n\nEnter Student No.: "); studno = br.readLine(); System.out.println("Student's Name:"); while ((student = in2.readLine()) != null) { if (student.charAt(0) == studno.charAt(0)) { for (int i = 1; i <= student.length()-1; i++) { System.out.print(student.charAt(i)); } } } in2.close(); System.out.println("Student's Subject/s:"); while ((profile = in1.readLine()) != null) { if (profile.charAt(0) == studno.charAt(0)) { for (int i = 1; i <= profile.length()-1; i++) { System.out.print(profile.charAt(i)); } System.out.println(); } } in1.close(); System.out.println("Enter again? (y/n): "); ans = br.readLine(); } while (ans.charAt(0) == 'y' || ans.charAt(0) == 'Y'); } } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } } while (choice.charAt(0) != '5') }

Description
Republic of the Philippines
Tarlac State University
College of Computer Studies
SY: 2010-2011



CASE STUDY
PROG3 JAVA



Submitted by:

Zablan, Ronnel
Vicente, Donna Belle V.
Estanislao, Mayflor O.
Tañedo, Melchor


System.out.println("\n\n\n\n\nPlease select from the choices");
System.out.println(" 1 - Register a Subject ");
System.out.println(" 2 - Register a Student ");
System.out.println(" 3 - Add Subject for Student ");
System.out.println(" 4 - View Student Profile ");
System.out.println(" 5 - Exit \n");
System.out.print("Your choice is: ");
choice = br.readLine();
choiceNum = Integer.parseInt(choice);



Comments

Want to learn?

Sign up and browse through relevant courses.

Name:
Your Email:
Password:
Country:
Contact no:


Area code Number
Subjects you are interested in:
Word verification: (Enter the text as in image)


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy
Donna Belle Mañebog
STUDENTS CORNER
User
2 Followers

Your Facebook Friends on WizIQ

Explore Similar Courses

Develop Android Apps with Java

Price:$300
$40

SAVE 86%

Give live classes, create & sell online courses

Try it free Plans & Pricing

Connect