我找不到代码使用大小写字母的方法,我只能找到一种方法让它运行一个或另一个...尝试了一段时间仍然没有管理,漂亮你看到的新人!提前致谢!
import java.util.*;
public class LectureTimes {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System. in );
char letter;
System.out.println("Enter your class and" + " you will recieve your lecture time");
do {
letter = sc.next().charAt(0);
} while (letter < 'a' || letter > 'd');
if (letter == 'A') {
System.out.println("Your class is at 10:00");
} else {
if (letter == 'a') {
System.out.println("Your class is at 10:00");
} else {
if …Run Code Online (Sandbox Code Playgroud) java ×1