Demo entry 6741875

main.java

   

Submitted by anonymous on May 16, 2018 at 17:48
Language: Java. Code size: 1.6 kB.

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pkg1406722;

import java.util.Scanner;

/**
 *
 * @author jingyi.lu14
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner kb = new Scanner(System.in);
        boolean exit = false;
        Dictionarystart a = new Dictionarystart();
        a.Readtextfile();
        a.Catalogue();
        
        while(!exit){
            System.out.print("What do you want to do (enter the number from 0-7): ");
    int n = kb.nextInt();
        switch (n) {
            case 1:
                System.out.print("\n");
                a.Displayallwords();
                System.out.print("\n");
                break;
            case 2:
                a.Search();
                break;
            case 3:
                a.DisplayAtRandom();
                break;
            case 4:
                a.Guess();
                break;
            case 5:
                a.AddaWord();
                break;
            case 6: 
                a.RemoveaWord();
                break;
            case 7:
                a.store();
            case 0:
                exit=true;
                break;
            default:
                System.out.println("Invalid input!");
        }
        }
                
        
        // TODO code application logic here
    }
    
}

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).