|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
Scanner banzhang1 = new Scanner(System.in);
String getName = banzhang1.nextLine();
System.out.println();这个就是要完成这个任务是代码,没有写完,不会写了,求帮助
- package lianxi;
- public class MyStudent {
- String name;
- String sex;
- int EnglishScore;
- int LinuxScore;
- int JavaScore;
- int TotalScore;
- public MyStudent() {
-
- }
- public MyStudent(String name, String sex, int EnglishScore,int LinuxScore, int JavaScore, int TotalScore
- ) {
- super();
- this.name = name;
- this.sex = sex;
- this.EnglishScore = EnglishScore;
- this.LinuxScore = LinuxScore;
- this.JavaScore = JavaScore;
- this.TotalScore = TotalScore;
- }
- public String getName() {//1 name
- return name;
- }
- public void getName(String name) {
- this.name = name;
- }
- public String getSex() {//2 sex
- return sex;
- }
- public void getSex(String sex) {
- this.sex = sex;
- }
- public int getEnglishScore() {//3 EnglishScore
- return EnglishScore;
- }
- public void getEnglishScore(int EnglishScore) {
- this.EnglishScore = EnglishScore;
- }
- public int getLinuxScore() {//4 LinuxScore
- return LinuxScore;
- }
- public void getLinuxScore(int LinuxScore) {
- this.LinuxScore = LinuxScore;
- }
- public int getJavaScore() {//5 JavaScore
- return JavaScore;
- }
- public void getJavaScore(int JavaScore) {
- this.JavaScore = JavaScore;
- }
- public int getTotalScore() {//6 TotalScore
- return TotalScore;
- }
- public void getTotalScore(int TotalScore) {
- this.TotalScore = TotalScore;//EnglishScore+LinuxScore+JavaScore
- }
- }
-
-
复制代码
我帮你改好了,累死我了, 要是不给我个最佳答案-》以后就不回答你的问题了哈!!! 太累了
首先说明一波:
你的:MyStudent.java这个文件是不用改的!
需要改的仅仅是:MyClass.java 且解释全在注释里了,而且我认为算是比较详细得了,累啊
我自认为我写的 满足了你的所有需求!
代码如下:
执行效果如下:
OK 希望对你有用吧
|
|