Advertisement
Guest User

Untitled

a guest
Mar 20th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. import java.io.File;
  2. import java.util.Scanner;
  3.  
  4. public class Question5 {
  5. public static void main(String[] args) {
  6. Scanner keyboard = new Scanner(System.in);
  7. {
  8. System.out.println("Enter word to spellcheck (or exit to end)");
  9. String word = keyboard.nextLine();
  10.  
  11. File file = new File("dictionary.txt");
  12.  
  13. if (!word.equals("exit"))
  14. {
  15. if (!word.equals("dictionary.txt")) {
  16. do {
  17. System.out.println(word + " is spelled correctly.");
  18. System.out.println("Enter word to spellcheck (or exit to end)");
  19. word = keyboard.nextLine();
  20. }
  21. while (!word.equals("exit"));
  22. } else if (!word.equals("dictionary.txt")) {
  23. do {
  24. System.out.println(word + " is not spelled correctly.");
  25. System.out.println("Enter word to spellcheck (or exit to end)");
  26. word = keyboard.nextLine();
  27. } while (!word.equals("exit"));
  28. }
  29. }System.out.println("Ending program...");
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement