package week2;
import java.lang.annotation.IncompleteAnnotationException;
import java.util.Scanner;
enum Sex{男,女};
class student{
String Name;
String[] classname = {"C语言","高数","线代","思想道德与修养"};
float[] score;
public void init() {
Scanner sc = new Scanner(System.in);
Sex sex;
score = new float[4];
System.out.println("请输入姓名");
Name = sc.next();
System.out.println("请输入性别");
System.out.println("请输入各科成绩");
System.out.println("请输入C语言成绩:");
score[0] = sc.nextFloat();
System.out.println("请输入高数成绩:");
score[1] = sc.nextFloat();
System.out.println("请输入线代成绩:");
score[2] = sc.nextFloat();
System.out.println("请输入思想道德与修养成绩:");
score[3] = sc.nextFloat();
}
}
public class Selfstudent {
public static void main(String[] args){
student stu = new student();
stu.init();
System.out.println("我的名字叫"+stu.Name+","+stu.sex+","+"我上学期通过努力,取得了好成绩,各门功课成绩如下:"
+stu.classname[0]+stu.score[0]+","+stu.classname[1]+stu.score[1]+","+stu.classname[2]+stu.score[2]
+stu.classname[3]+stu.score[3]);
}
}