Question
Java Need help fixing this program: When I run it, it will have 16 lines on the side. When I press one of the letters
Java
Need help fixing this program:
When I run it, it will have 16 lines on the side. When I press one of the letters in parathesis and press enter it goes back to the opening page but the numbers dissapear.
*********************************************************************************************
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Project {
public static void main(String[] args) throws IOException {
System.out.println("\t\t\t\t\t\tJMUBiblio Bibliography Manager");
System.out.println("\t\t\t\t\t\t\t\t CS159 (Fall 2017)");
System.out.println();
System.out.println();
for (int i = 1; i <=16 ; i++) {
System.out.println(i+".");
}
System.out.println();
String operation="";
do {
System.out.println("(A)dd, (E)dit, (D)elete,(S)earch, read(L)ist, (N)ext, (B)ack, (Q)uit");
System.out.println();
operation = getInput();
switch (operation.toLowerCase()) {
case "a":
pause("This function is not currently available. Press
clearScreen();
break;
case "e":
clearScreen();
System.out.println("Edit Book");
System.out.println();
pause("This function is not currently available. Press
clearScreen();
break;
case "d":
clearScreen();
pause("This function is not currently available. Press
clearScreen();
break;
case "s":
clearScreen();
pause("This function is not currently available. Press
clearScreen();
break;
case "l":
pause("This function is not currently available. Press
clearScreen();
break;
case "n":
pause("This function is not currently available. Press
clearScreen();
break;
case "b":
pause("This function is not currently available. Press
clearScreen();
break;
case "q":
System.exit(0);
break;
default:
System.out.println("Incorrect entry (" + operation + ").Please re-enter.");
break;
}
}while(operation!="q");
}
public static void display(String str)
{
System.out.print(str);
}
public static String getInput() throws IOException {
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Choose Operation -> ");
String operation = input.readLine();
return operation;
}
public static void pause(String message) throws IOException {
System.out.println(message);
System.in.read();
}
public static void clearScreen()
{
int lines =25;
int columns = 80;
for(int i=1;i<=lines;i++)
{
for (int j = 0; j System.out.print(" "); } System.out.println(""); } } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started