资源简介
ssd3 practical quiz 8ssd3 practical quiz 8ssd3 practical quiz 8ssd3 practical quiz 8ssd3 practical quiz 8ssd3 practical quiz 8

代码片段和文件信息
import java.util.*;
/**
* This class contains methods to process array lists of {@link Student}
* objects.
*
* @author autor name
* @version 1.0.0
* @see Student
* @see ArrayList
*/
public class StudentArrayList {
/**
* Returns an array list with three elements.
*
* @param first a Student
object.
* @param second a Student
object.
* @param third a Student
object.
* @return an array list with the objects first
* second
and third
*/
public static ArrayList makeArrayList(
Student first
Student second
Student third) {
ArrayList student=new ArrayList();
student.add(first);
student.add(second);
student.add(third);
return student;
}
/**
* Returns an array list with the same elements of the specified array
* arranged in the same order.
*
* @param array an array with Student
objects .
* @return an array list with the same elements of the specified array
* arranged in the same order
*/
public static ArrayList makeArrayListFromArray(Student[] array) {
ArrayList student=new ArrayList();
for(Student std:array){
student.add(std);
}
return student;
}
/**
* Returns true
if the specified array list contains a
* student whose id matches the specified ID.
*
* @param arrayList an array list of Student
objects.
* @param id a student ID.
* @return true
if the specified array list contains a
* student whose ID matches the specified ID;
* false
otherwise.
*/
public static boolean hasStudent(
ArrayList arrayList
int id) {
for(Student std:arrayList){
if(std.getId()==id)
return true;
}
return false;
}
/**
* Returns the number of students in the specified array list whose
* grade is greater than or equal to the specified grade.
*
* @param arrayList an array list of Student
objects.
* @param grade a grade.
* @return the number of students in the specified array list whose
* grade is greater than or equal to the specified grade.
*/
public static int countGradeGreaterOrEqual(
ArrayList arrayList
int grade) {
int count=0;
for(Student std:arrayList){
if(std.getGrade()>=grade)
++count;
}
return count;
}
/**
* Returns the smallest grade of the students in the specified array list.
*
* This method assumes that the array list is not empty.
*
* @param arrayList an array list of Student
objects.
* @return the smallest grade of the students
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2010-11-30 22:26 practical quiz 8\
目录 0 2010-11-30 22:26 practical quiz 8\student-files\
文件 1088 2006-01-11 06:07 practical quiz 8\student-files\Student.class
文件 2512 2005-12-03 00:19 practical quiz 8\student-files\Student.java
文件 1382 2006-01-11 06:07 practical quiz 8\student-files\StudentArrayList.class
文件 4392 2005-12-01 01:44 practical quiz 8\student-files\StudentArrayList.java
文件 6463 2006-01-11 06:07 practical quiz 8\student-files\TestStudentArrayList.class
文件 9785 2005-12-01 01:44 practical quiz 8\student-files\TestStudentArrayList.java
文件 5373 2010-11-30 22:24 practical quiz 8\StudentArrayList.java
- 上一篇:基于proteus的8086和8253
- 下一篇:基于单片机的FSK调制器设计
相关资源
- Academic Writing--a practical guide for studen
- Practical Methods of Optimization 第二版 Fl
- 川大数据库系统(SSD6)历年考题、
- 中文版Introduction to lens design with prac
- 完整中文版Introduction to Lens Design Wit
- Graph Algorithms:Practical Examples in Apach
- A Practical Guide to Support Vector Classifica
- practicalgrpc.pdf
- Engineeing Design via Surrogate Modelling-A pr
- Practical Optimization
- Practical Graph Analytics with Apache Giraph(
- Practical Game AI Programming
- iOS Drawing Practical UIKit Solutions 无水印
- Practical Reinforcement Learning 无水印pdf转
- ssd3全部答案,最全的
- SSD3答案包含两个版本
- Flight_Control_Systems_-_practical_issues_in_d
- professional_cmake_a_practical_guide_craig_sco
- UVM实用指南-A Practical Guide to Adopting
- Interest Rate Markets - A Practical Approach t
- 数据挖掘实用机器学习技术Data Minin
- A Practical Guide to TPM 2.0
- Data_Mining-Practical Machine Learning Tools
- Fundamentals of Kalman Filtering: A Practical
- Apress Practical Web 2.0
- Fundamentals of Kalman Filtering A Practical A
- Mastering OpenCV with Practical Computer Visio
- Windows Debugging Practical Foundation
- 数据挖掘实用机器学习技术 Data Mini
- verilog hdl synthesis a practical primer.pdf 中
评论
共有 条评论