JAVA编程问题
下面是题目(英文的)Createa“Grades”classwiththefollowingAPIConstructorGrades(intstudentCount,in...
下面是题目(英文的)
Create a “Grades” class with the following API
Constructor
Grades
(int studentCount, int min_grade, int max_grade)
This will create an array of student grades. Each grade will be a random number from min_grade to max_grade, inclusive.
Methods
1) toString()
prints the grades in this format:
grades: [78, 58, 76, 101, 59, 55, 84, 91, 84, 67]
2) An accessor and a multator for a grade
3) An equals method
4) A clone method
5) A method that sorts the grades in ascending order
6) A method that sorts the grades in descending order
7) A method that returns the highest grades
8) A method that returns the average grade to one decimal place.
9) A method that returns the median grade
10 ) A method that returns the modes
11 ) A method that returns an Array containing the number of F’s D’s C’s B’s and A’s
[7, 2, 1, 0, 0]
12 ) A method that returns an Array containing each student’s letter grade
[F, F, D, F, F, C, F, F, D, F]
13 ) The standard deviation of the grades to one decimal place
然后这是一个成品的例子:
how many students?
10
min grade:
0
max grade:
100
grades: [59, 1, 70, 1, 30, 7, 48, 100, 45, 83]
sorted grades: [1, 1, 7, 30, 45, 48, 59, 70, 83, 100]
reverse grades: [100, 83, 70, 59, 48, 45, 30, 7, 1, 1]
The highest grade is: 100
Average grade: 44.4
Median grade: 46
Modes [1]
Letter grades: [7, 0, 1, 1, 1]
[F, F, C, F, F, F, F, A, F, B]
SD: 32.9
Cloned grades are equal
grade to change:
1
new grade:
100
grades: [59, 100, 70, 1, 30, 7, 48, 100, 45, 83]
Changed grades are not equal
how many students?
p
how many students?
-1
how many students?
0
how many students?
11
min grade:
105
max grade:
50
grades: [56, 59, 92, 94, 80, 55, 103, 101, 78, 51, 69]
sorted grades: [51, 55, 56, 59, 69, 78, 80, 92, 94, 101, 103]
reverse grades: [103, 101, 94, 92, 80, 78, 69, 59, 56, 55, 51]
The highest grade is: 103
Average grade: 76.2
Median grade: 78
Modes [51, 55, 56, 59, 69, 78, 80, 92, 94, 101, 103]
Letter grades: [4, 1, 1, 1, 4]
[F, F, A, A, B, F, A, A, C, F, D]
SD: 18.5
Cloned grades are equal
grade to change:
9
new grade:
100
grades: [56, 59, 92, 94, 80, 55, 103, 101, 78, 100, 69]
Changed grades are not equal
求解答 展开
Create a “Grades” class with the following API
Constructor
Grades
(int studentCount, int min_grade, int max_grade)
This will create an array of student grades. Each grade will be a random number from min_grade to max_grade, inclusive.
Methods
1) toString()
prints the grades in this format:
grades: [78, 58, 76, 101, 59, 55, 84, 91, 84, 67]
2) An accessor and a multator for a grade
3) An equals method
4) A clone method
5) A method that sorts the grades in ascending order
6) A method that sorts the grades in descending order
7) A method that returns the highest grades
8) A method that returns the average grade to one decimal place.
9) A method that returns the median grade
10 ) A method that returns the modes
11 ) A method that returns an Array containing the number of F’s D’s C’s B’s and A’s
[7, 2, 1, 0, 0]
12 ) A method that returns an Array containing each student’s letter grade
[F, F, D, F, F, C, F, F, D, F]
13 ) The standard deviation of the grades to one decimal place
然后这是一个成品的例子:
how many students?
10
min grade:
0
max grade:
100
grades: [59, 1, 70, 1, 30, 7, 48, 100, 45, 83]
sorted grades: [1, 1, 7, 30, 45, 48, 59, 70, 83, 100]
reverse grades: [100, 83, 70, 59, 48, 45, 30, 7, 1, 1]
The highest grade is: 100
Average grade: 44.4
Median grade: 46
Modes [1]
Letter grades: [7, 0, 1, 1, 1]
[F, F, C, F, F, F, F, A, F, B]
SD: 32.9
Cloned grades are equal
grade to change:
1
new grade:
100
grades: [59, 100, 70, 1, 30, 7, 48, 100, 45, 83]
Changed grades are not equal
how many students?
p
how many students?
-1
how many students?
0
how many students?
11
min grade:
105
max grade:
50
grades: [56, 59, 92, 94, 80, 55, 103, 101, 78, 51, 69]
sorted grades: [51, 55, 56, 59, 69, 78, 80, 92, 94, 101, 103]
reverse grades: [103, 101, 94, 92, 80, 78, 69, 59, 56, 55, 51]
The highest grade is: 103
Average grade: 76.2
Median grade: 78
Modes [51, 55, 56, 59, 69, 78, 80, 92, 94, 101, 103]
Letter grades: [4, 1, 1, 1, 4]
[F, F, A, A, B, F, A, A, C, F, D]
SD: 18.5
Cloned grades are equal
grade to change:
9
new grade:
100
grades: [56, 59, 92, 94, 80, 55, 103, 101, 78, 100, 69]
Changed grades are not equal
求解答 展开
2个回答
2018-07-20 · IT行业特种兵的摇篮!
关注
展开全部
用下面的API创建一个“等级”类
构造函数
分数
int学生计数,int MINI等级,int Max等级)
这将创建一系列学生成绩。每个年级将是一个随机数从最小年级到最大年级,包括。
方法
1)toSTRIN()
打印这种格式的等级:
等级:[ 78, 58, 76,101, 59, 55,84, 91, 84,67 ]
2)用于分级的存取器和多路选择器
3)等值法
4)克隆方法
5)按升序排序等级的方法
6)按降序排列等级的方法
7)返回最高等级的方法
8)将平均成绩返回到小数点的方法。
9)返回中位数的方法。
10)返回模式的方法 。
11)返回一个数组,其中包含F的D的C的B和A的数目
〔7, 2, 1,0, 0〕
12)返回包含每个学生的字母等级的数组的方法
[f,f,d,f,f,c,f,f,d,f]
13)等级到一位小数的标准差
一、
有多少学生?
十
最小年级:
零
最大等级:
一百
等级:[ 59, 1, 70,1, 30, 7,48, 100, 45,83 ]
排序等级:[ 1, 1, 7,30, 45, 48,59, 70, 83,100 ]
反向等级:[ 100, 83, 70,59, 48, 45,30, 7, 1,1 ]
最高等级为:100。
平均成绩:44.4分
中位数:46
模式〔1〕
字母等级:[ 7, 0, 1,1, 1 ]
[f,f,c,f,f,f,f,a,f,b]
SD:32.9
克隆等级相等
品位变化:
一
新年级:
一百
等级:[ 59, 100, 70,1, 30, 7,48, 100, 45,83 ]
变年级不等于
有多少学生?
磷
有多少学生?
- 1
有多少学生?
零
有多少学生?
十一
最小年级:
一百零五
最大等级:
五十
等级:[ 56, 59, 92,94, 80, 55,103, 101, 78,51, 69 ]
排序等级:[ 51, 55, 56,59, 69, 78,80, 92, 94,101, 103 ]
反向等级:[ 103, 101, 94,92, 80, 78,69, 59, 56,55, 51 ]
最高等级为:103。
平均成绩:76.2分
中位数:78
模式〔51, 55, 56、59, 69, 78、80, 92, 94、101, 103〕
字母等级:[ 4, 1, 1,1, 4 ]
[f,f,a,b,f,a,a,c,f,d]
SD:18.5
克隆等级相等
品位变化:
九
新年级:
一百
等级:[ 56, 59, 92,94, 80, 55,103, 101, 78,100, 69 ]
变年级不等于
构造函数
分数
int学生计数,int MINI等级,int Max等级)
这将创建一系列学生成绩。每个年级将是一个随机数从最小年级到最大年级,包括。
方法
1)toSTRIN()
打印这种格式的等级:
等级:[ 78, 58, 76,101, 59, 55,84, 91, 84,67 ]
2)用于分级的存取器和多路选择器
3)等值法
4)克隆方法
5)按升序排序等级的方法
6)按降序排列等级的方法
7)返回最高等级的方法
8)将平均成绩返回到小数点的方法。
9)返回中位数的方法。
10)返回模式的方法 。
11)返回一个数组,其中包含F的D的C的B和A的数目
〔7, 2, 1,0, 0〕
12)返回包含每个学生的字母等级的数组的方法
[f,f,d,f,f,c,f,f,d,f]
13)等级到一位小数的标准差
一、
有多少学生?
十
最小年级:
零
最大等级:
一百
等级:[ 59, 1, 70,1, 30, 7,48, 100, 45,83 ]
排序等级:[ 1, 1, 7,30, 45, 48,59, 70, 83,100 ]
反向等级:[ 100, 83, 70,59, 48, 45,30, 7, 1,1 ]
最高等级为:100。
平均成绩:44.4分
中位数:46
模式〔1〕
字母等级:[ 7, 0, 1,1, 1 ]
[f,f,c,f,f,f,f,a,f,b]
SD:32.9
克隆等级相等
品位变化:
一
新年级:
一百
等级:[ 59, 100, 70,1, 30, 7,48, 100, 45,83 ]
变年级不等于
有多少学生?
磷
有多少学生?
- 1
有多少学生?
零
有多少学生?
十一
最小年级:
一百零五
最大等级:
五十
等级:[ 56, 59, 92,94, 80, 55,103, 101, 78,51, 69 ]
排序等级:[ 51, 55, 56,59, 69, 78,80, 92, 94,101, 103 ]
反向等级:[ 103, 101, 94,92, 80, 78,69, 59, 56,55, 51 ]
最高等级为:103。
平均成绩:76.2分
中位数:78
模式〔51, 55, 56、59, 69, 78、80, 92, 94、101, 103〕
字母等级:[ 4, 1, 1,1, 4 ]
[f,f,a,b,f,a,a,c,f,d]
SD:18.5
克隆等级相等
品位变化:
九
新年级:
一百
等级:[ 56, 59, 92,94, 80, 55,103, 101, 78,100, 69 ]
变年级不等于
2018-07-20
展开全部
春晓(杜牧)
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询