
I need some help I've got my java code and am having difficulty to spot what errors there are is someone able to help
import java.util.Scanner;
public class Post {
public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("Enter the letter type: "); String type = sc.nextLine(); Process Letter post(); }
private static void post(String type) { throw new UnsupportedOperationException("Not yet implemented"); }
private static void post() { throw new UnsupportedOperationException("Not yet implemented"); }
private static class Process {
public Process() { } }
private void processLetter(String input) { if (input.equalsIgnoreCase("bill")) { System.out.println("Bills must be paid."); } else if (input.equalsIgnoreCase("circular")) { System.out.println("Circulars are thrown away."); } else if (input.equalsIgnoreCase("postcard")) { System.out.println("Postcards are put on the wall."); } else if (input.equalsIgnoreCase("letter")) { System.out.println("Personal letters are read and have replies written for them."); } else { System.out.println("Not recognized."); } } }

import java.util.Scanner;
public class Post {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter the letter type: ");
String type = sc.nextLine();
processLetter(type);
}
private static void post(String type) {
throw new UnsupportedOperationException("Not yet implemented");
}
private static void post() {
throw new UnsupportedOperationException("Not yet implemented");
}
private static class Process {
public Process() {
}
}
private static void processLetter(String input) {
if (input.equalsIgnoreCase("bill")) {
System.out.println("Bills must be paid.");
} else if (input.equalsIgnoreCase("circular")) {
System.out.println("Circulars are thrown away.");
} else if (input.equalsIgnoreCase("postcard")) {
System.out.println("Postcards are put on the wall.");
}
else if (input.equalsIgnoreCase("letter")) {
System.out.println("Personal letters are read and have replies written for them.");
}
else {
System.out.println("Not recognized.");
}
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.