早教吧作业答案频道 -->其他-->
麻烦各位JAVA达人看看我写的JAVA程序错在哪,//publicclassGrades{publicstaticvoidmain(String[]args){Studentstudent1=newStudent("Mary");//createstudent2,"Mike"Studentstudent2=newStudent("Mike");//inputgradesforMarySystem
题目详情
麻烦各位JAVA达人看看我写的JAVA程序错在哪,
//
public class Grades
{
public static void main(String[] args)
{
Student student1 = new Student("Mary");
//create student2,"Mike"
Student student2 = new Student("Mike");
//input grades for Mary
System.out.println("please input the scores of the student:");
student1.inputGrades();
//print average for Mary
student1.getAverage();
student1.ptritName();
System.out.println("please input the scores of the student:");
student2.inputGrades();
student2.getAverage();
student2.ptritName();
//input grades for Mike
//print average for Mike
}
}
感激不尽
//
public class Grades
{
public static void main(String[] args)
{
Student student1 = new Student("Mary");
//create student2,"Mike"
Student student2 = new Student("Mike");
//input grades for Mary
System.out.println("please input the scores of the student:");
student1.inputGrades();
//print average for Mary
student1.getAverage();
student1.ptritName();
System.out.println("please input the scores of the student:");
student2.inputGrades();
student2.getAverage();
student2.ptritName();
//input grades for Mike
//print average for Mike
}
}
感激不尽
▼优质解答
答案和解析
首先,像private,public这些词是不可以大写的,你要全部改成小写其次,你在定义getAverage函数的时候是代参的,结果你最后在调用的时候没有赋参数,所以肯定是错的.最后,inputGrades函数,输入不是那么写的,要先写 Scanner...
看了麻烦各位JAVA达人看看我写的...的网友还看了以下:
计算电压u的相量时,u=220√2sin(wt-120°)V=220∠-120°=220(-1/2- 2020-03-30 …
Heis、Iam、Threehours、Tooeasy连读时中间都加个/j/,我怎么都加不进去这个 2020-05-17 …
英语中这两个发音有什么区别?jə和imuscular[['mʌskjəlɚ]]那个jə我听老外老发 2020-05-21 …
帮我把这段对话翻成英文C:前一阵子你不是去西班牙吗?J:很好玩,我度过了一个美好的假期!C:是喔! 2020-06-04 …
5.(2015湖南长沙中考)填人下列语段空缺处的句子,顺序排列最恰当的一项是(2分)()语文的学习 2020-06-10 …
双缝干涉明条纹的光程差公式怎么来的就是那个明条纹的光程差等于级别乘以波长,即δ=jλ,我想知道怎么 2020-06-12 …
傅里叶变换里如下式子怎么得来的exp(-j*pi/2)=-j我晕啊为什么相等啊 2020-06-16 …
数控车g03和g03i和j我知道是圆心减去起点哎很是苦恼我是数控车圆心减去起点的距离就是i和k但是 2020-07-03 …
boy表示B、dog表示D、Jack表示J.其他字母对应哪些单词呢?很多美剧战争片中经常出现报密码的 2020-11-07 …
英语翻译口语.T你还是先冷静一下J我很冷静,但是我很无助T好兄弟,当你们意见产生分歧的时候,不如站在 2020-11-23 …