2

私たちの課題はこれですhttps://docs.google.com/document/d/16hHb8WUGehbYLCNrSpJspP8x5GJNCR2q2chnG_yFPSo/pub

ここに書かれているファイルを使用しますhttps://docs.google.com/document/d/1BxIKe4ZEEpWHmBk2O2FJit6frk5BZSm6SozHOAKWqWU/pub

私はこのサイトを使用して、人々に私のプロジェクトを実行してもらうつもりはありません。私は本当に迷っているので、正しい方向に向けられるでしょう.

switch ステートメントに少し問題があり、メニューが機能し始めています。

package student;

import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.IOException;
import java.lang.*;
import java.util.*;


public class TestStudent {

    public static void main (String[] args) throws IOException
    {

        InputStreamReader isr = new InputStreamReader (System.in );
        BufferedReader stdin = new BufferedReader( isr );


        String check, tempString, tempString2;
        int tempInt, tempInt2;
        boolean quit = false;

        do
        {
            System.out.println("A - Add student, D - Delete student, F - Find student, H - Help, S - Scores, X - Exit");
            check = stdin.readLine();
            switch (check)
            {

                case "A":
                case "a":
                    System.out.println("Enter the student's name");
                    tempString = stdin.readLine();
                    System.out.println("Enter the student's ID number");

                //I'm stuck on where to go from here

                case "D":
                case "d":
                    System.out.println("Enter the ID number of the student you wish to delete");
                    tempString = stdin.readLine();
                    System.out.println("Student has been deleted");

                case "F":
                case "f":
                    System.out.println("Enter the Name or ID number of the student you would like to find");
                    tempString = stdin.readLine();
                    System.out.println("");

                case "H":
                case "h":
                    System.out.println("");

                case "S":
                case "s":
                    System.out.println("Enter the Name or ID number of the Student");

                case "X":
                case "x":
                    System.out.println("System shutting down");
            }

       }    //Error saying while is expected     
   }   //Error "Illegal start of an expression
}
4

2 に答える 2