Hey guys,
was just wondering if anyone would be able to help me out with this question - im a complete beginner to this whole java subject:
Techno-Tech is a small private college running various diploma courses. Currently, the college consolidates all their results manually.
You have been called as an IT consultant who can help them create a small JAVA program that will help their teachers consolidate the results and grade their students. Currently, the college does not have any database server and is not interested in buying one in near
future. You are required to create a JAVA program using flat files only.
1. College Requirements:
The requirements of your program are given below:
--> Each student is enrolled in 4 subjects where they have already got the marks.
-->The eacher can add new student that get saved into file, delete a students that will be
deleted from the file.
-->The teacher will be able to generate the result on the basis of the following grading rules:
Marks (Total of Marks1, marks2 and marks2) > 85% - Grade “HD”
Marks (Total of Marks1, marks2 and marks2) 70 – 85% - Grade “D”
Marks (Total of Marks1, marks2 and marks2) 60 – 69% - Grade “C”
Marks (Total of Marks1, marks2 and marks2) 50 – 59% - Grade “P”
Marks (Total of Marks1, marks2 and marks2) <50% - Grade “F”
2. Required Technical Solution:
Write a JAVA program that will allow the teachers to use your program and generate
the results of their students. Your JAVA program is console based program that will
ask the teacher to select from the following options:
1. Create Students file
2. Add new student to file
3. Delete a student from file
4. Print Grades
5. Exit.
When teacher creates a new student the details of the student and the marks are taken as user input from the teacher.
You will need to do a complete exception handling and data validations for this
program so get the validated data for your program
HERE's WHAT i have so far: (for part 2.)
public source; import java.io.ObjectInput; public class Question2() { public Object; public class student { private static final String System = null; private int input; public void menu() { //print the menu System.out.println("1. Create Student file"); System.out.println("2. Add New Student file"); System.out.println("3. Delete Student file"); System.out.println("4. Print Grades"); System.out.println("5. Exit"); //get input input = keyboard.nextInt(); // process the input and invoke the method required switch (input) { case 1: //call the method to create student file break; case 2: //call the method to add a new student to file break; case 3: // call the method to delete a student from file break; case 4: // call the method to print grades break; case 5: // call the method to exit } } public void createFile() { //creating the file String filename; System.out.println("Enter a filename"); filename = new keyboard.next(); FileoutFile = new File(filename); FileoutputStream outStream = new FileOutputStream(outFile); outObjectStream.close(); } public void addToFile() { String filename; System.out.println("Enter a filename"); filename = new keyboard.next(); //ensure that file existed otherwise call method createFile //get input for student and marks FileWriter fileWriter = new FileWriter(filename,true); //append to the file, false will replace BufferedWriter bufferWriter = new BufferedWriter(fileWriter); bufferWriter.write(student); bufferWriter.close(); } public void deleteFile() { String filename; System.out.println("Enter a filename"); filename = new keyboard.next(); //method to delete a student //get the filename in which the student record is going to be deleted from file //get input which student to delete //read file and in an array //loop through the array //search the student in the array //if not the student to be deleted, write to file //method to print grade //get the filename // read file and calculate the average mark //use if statements to figure out the letter grade and print to console public void File;outfile = new File(filename); FileInputStream inStream = new FileInputStram(infile); FileInputStream outStream = new FileOutputStream(outFile); ObjectInputStream inObjectStream = new ObjectInputStream;
This is what have so far, but I'm not too sure hhow to finish it. If you can help out could you please explain it as you go?
Any help would be greatly appreciated!
TTHANKYou so much in advance!
---------------------