0% found this document useful (0 votes)
1 views2 pages

Recordsmenu

record menu for whatever you want
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views2 pages

Recordsmenu

record menu for whatever you want
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

package whatever;

import java.io.BufferedReader;//read text from an input character stream, such as


files or console.
import java.io.IOException;
import java.io.InputStreamReader; //reads bytes from an InputStream and converts
them into characters using a specified character encoding.

class recordsmenu {

static BufferedReader br = new BufferedReader(new


InputStreamReader(System.in));
/*new InputStreamReader(System.in) creates an InputStreamReder that reads
bytes from System.in
* and converts them into characters. */

//menu
public void showMenu() throws IOException{
AddStudentRecords asr = new AddStudentRecords(); //creating an
object for the class AddStudentRecords

System.out.println("[1] Add Records");


System.out.println("[2] Display Records");
System.out.println("[3] Search Records");
System.out.println("[4] Edit Records");
System.out.println("[5] Clear All Records");
System.out.println("[6] Exit");
System.out.print("Your Choice: ");
int choice = Integer.parseInt(br.readLine());//readLine method
reads an entire line of text entered by the user until they press Enter.
System.out.println("\n-----------------------------");

switch(choice) {
case 1:
asr.addingRecords(); //calling the addingRecords method
from the class AddStudentRecords
break;
case 2:
asr.readingRecords(); //calling the readingRecords method
from the class AddStudentRecords
break;
case 3:
asr.searchRecord(); //calling the searchRecords method from
the class AddStudentRecords
break;
case 4:
asr.editRecord(); //calling the editRecords method from the
class AddStudentRecords
break;
case 5:
asr.clear();//calling the clear method from the class
AddStudentRecords
break;
case 6:
System.exit(1); //exits the program
break;
default:
System.out.println("\nInvalid Choice!");
showMenu();
}
}//end showMenu
}

You might also like