Part 2: Students and Courses, Part 1 (8 Points)
You may use an IDE or a text editor, but I will test this by compiling and running from the command line so be sure to test it that way. (No packages allowed) The program will not compile and run at the command line if you include any package statements.
Save this program, for a future assignment (Lab 8).
Here are the steps:
(1) Create a Student class containing an ID, a last name, and a list of course names such as "COP2210" or "COP2250". The ID should be an integer which is printed with leading zeros.
(2) Create a class named StudentTest that contains a List of students. This should not be a string of multiple courses. Do not use the list provided here. In the class constructor, create 15 students and add them to the list. Each student's ID must be different. Each student you add to the list must contain at least 3 different course names. At least one should have two course names and at least one should have four course names. Make sure the students do not all have the same courses, although there should be some overlap (see the sample below). The student names must be inserted into the list in random order (not sorted).
(3) Sort the list in ascending order by student last name and display the list. For each student, display the ID with leading zeros, last name, and list of courses on a single line. Here is sample output. Note how the tab character is inserted after the name to line up the next column containing courses. Be sure there is no trailing comma at the end of the list of courses.
Submit a zip file called FirstnameLastnamelab1.zip. It should contain: (2 Points)
- The PDF file or JPG file from Part 1.
- All Java source files from Part 2.
- Do not include any other files or folders, even if you are an Apple user.
A Java submission must compile and run from the command line or it will earn a 0 and
will not be graded further. Do not include package statements or this will happen.
Recently Asked Questions
- A quality control expert wants to estimate the proportion of defective components that are being manufactured by his company. A sample of 300 components showed
- Can you help me with my homework, it has to do with petty cash
- A one year Euro Call selling for $5. Stock price is 64, strike is 60. Rf is 0%. How much is the cost to construct a straddle strategy using this Euro call