subject

10.8 zyLab: Print Roster Given a class called Student and a class called Course that contains an ArrayList of Student. Write a method called printRoster() as described below.
Code:
import java. util.*;
import java. io.*;
/
* A list of students in a course
/
public class Course{
/** collection of Students */
private ArrayList roster;
/
Constructor for objects of class Course
/
public Course(){
roster = new ArrayList();
}
/
Use a for-each loop to print students one per line.
Use the provided toString() for Student.
Afterwords, print a final line that displays the
total number of students. For exampple:
First Last 3.2
First Last 2.5
First Last 4.0
Students: 3
/
public void printRoster(){
/** Your code goes here */

}

/
Add a student to the course
/
public void addStudent(Student s){
roster. add(s);
}

/
Main method for testing
/
public static void main(String args[]){
Course cis162 = new Course();
cis162.addStudent(new Student("Henry", "Cabot", 3.2));
cis162.addStudent(new Student("Brenda", "Stern", 3.2));
cis162.addStudent(new Student("Lynda", "Robison", 3.2));
cis162.addStudent(new Student("Jane", "Flynn", 3.2));
cis162.printRoster();
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:00
Hyperactive media sales has 10 windows 7 laptop computers used by sales-people in the organization. each laptop computer has several customized applications that are used during the sales process as well as customer relationship management software. all of the applications on the laptops are difficult to configure and have large data files. if all of the laptops have current hardware, what is the easiest way to install windows 10 on them?
Answers: 1
question
Computers and Technology, 22.06.2019 22:30
What is the most popular genre of video games?
Answers: 1
question
Computers and Technology, 23.06.2019 02:30
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of file type of operating system used
Answers: 2
question
Computers and Technology, 24.06.2019 05:30
Why is hard disk space important to an audio engineer? why are usb ports and firewire ports useful for an audio engineer? explain in 2-3 sentences. (3.0 points) here's a list of different audio software: ableton live apple inc.'s garageband apple inc.'s logic studio digidesign's pro tools propellerhead sofware's reason sony creative software's acid pro steinberg cubase steinberg nuendo choose one of the software programs listed above, and then go to that software program's web site. read about what the software program is used for, and then write 4-5 sentences about what you learned. (10.0 points) which type of software license is the most limiting? why? explain in 2-3 sentences. (3.0 points) when sending a midi channel voice message, how can you control the volume of the sound? explain in 2-3 sentences. (4.0 points)
Answers: 1
You know the right answer?
10.8 zyLab: Print Roster Given a class called Student and a class called Course that contains an Ar...
Questions
question
Business, 20.12.2021 22:00
question
History, 20.12.2021 22:00
question
Mathematics, 20.12.2021 22:00
question
Mathematics, 20.12.2021 22:00
question
Mathematics, 20.12.2021 22:00
question
Mathematics, 20.12.2021 22:00
Questions on the website: 13722367