これは、形式/整頓のためです。私が知っているすべてのバックラッシュ t (\t) は、うまく機能していないようです。これが私のコードです:
import java.util.Scanner;
public class RegisterStudent {
public static void register() {
System.out.println("----------------------------------------");
System.out.println("Student Class Card Evaluation System");
System.out.println("----------------------------------------");
System.out.println("Personal Data");
Scanner input = new Scanner(System.in);
System.out.print("\tEnter student no.: ");
long studNo = input.nextLong();
System.out.print("\tEnter first name: ");
String fName = input.next();
System.out.print("\tEnter last name: ");
String lName = input.next();
System.out.print("\tEnter course: ");
String course = input.next();
System.out.println();
System.out.println("----------------------------------------");
System.out.println("Subject: Computer Programming 2");
System.out.println("----------------------------------------");
System.out.println();
System.out.print("\tPrelim Grade: ");
double pg = input.nextDouble();
System.out.print("\tMidterm Grade: ");
double mg = input.nextDouble();
System.out.print("\tPrefinal Grade: ");
double pfg = input.nextDouble();
System.out.print("\tFinal Grade: ");
double fg = input.nextDouble();
System.out.println();
System.out.println("----------------------------------------");
double gwa = (pg + mg + pfg + fg)/4;
System.out.println();
System.out.println("Student Evaluated successfully...");
System.out.println("Viewing Report...");
System.out.println();
System.out.println("--------------------------------------------------------------------------------------------");
System.out.println("ID No.\t\t" + "LASTNAME\t\t" + "FIRSTNAME\t\t" + "COURSE\t\t"
+ "PG\t\t" + "MG\t\t" + "PFG\t\t" + "FG\t\t" + "GWA");
System.out.println("--------------------------------------------------------------------------------------------");
System.out.println(studNo + "\t\t" + lName + "\t\t" + fName + "\t\t" + course + "\t\t"
+ pg + "\t\t" + mg + "\t\t" + pfg + "\t\t" + fg + "\t\t" + gwa);
ユーザーが入力するものはすべて、適切に配置する必要があります。私のプログラムを修正するのを手伝ってください、ありがとう!