Sample Input 1:
Enter the first letter:R
Enter the second letter:A
Enter the third letter:I
Enter the fourth letter:N
Enter the fifth letter:B
Enter the sixth letter:O
Enter the seventh letter:W
Sample Output 1:
RAINBOW
Sample Input 2:
Enter the first letter:R
Enter the second letter:E
Enter the third letter:I
Enter the fourth letter:N
Enter the fifth letter:B
Enter the sixth letter:O
Enter the seventh letter:W
Sample Output 2:
The spelling is wrong
Code:
public class spellcheck {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
String str1;
String str2 = "rainbow";
int i = 0;
String a[] = new String[7];
System.out.print("Enter the first letter:");
a[0] = scan.nextLine();
System.out.print("Enter the first letter:");
a[1] = scan.nextLine();
System.out.print("Enter the first letter:");
a[2] = scan.nextLine();
System.out.print("Enter the first letter:");
a[3] = scan.nextLine();
System.out.print("Enter the first letter:");
a[4] = scan.nextLine();
System.out.print("Enter the first letter:");
a[5] = scan.nextLine();
System.out.print("Enter the first letter:");
a[6] = scan.nextLine();
}
}
What should be the next step?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…