Need help with school work...
Write a Java program to read in a line of text from keyboard. Then, act as follows (modifying the string each time):
If the user enters “n” shift all letters in the string forward 1 (A -> B, B -> C, etc.) and print the result.
If the user enters “p” shift all letters in the string backward 1 (A -> Z, B -> A, etc.) and print the result.
If the user enters anything else, exit the program.
I don't understand any of this, plz help me...


Do your work yourself. Use
import java.util.Scanner;
public class R{
public static void main(String args[]){
Scanner lineReader = new Scanner(System.in);
System.out.println("Enter any string");
String a = lineReader.nextLine();
System.out.println("Enter any integer");
int i = lineReader.nextInt();
}}