QuestionQuestion

In this program you will keep track of Students in a Course. The maximum number of students in a course is 100. There is no error method if the user tries to enter too many students. The program just does not allow the extra students to be added.

You will keep track of the course name, the names of the students, and the number of students in a course. The main method is provided for you and you will not change anything in it.

The program will be able to add students, drop students, see the name of the course and find out how many students are currently enrolled in the course.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/


import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

/**
*
* @author
*/
public class Course {

    private String courseName;
    private ArrayList<String> students = new ArrayList<>();

    public Course(String courseName){
       this.courseName = courseName;
    }

    public void addStudent(String student){
       if (students.size() < 100) {
            students.add(student);
       }
    }

    public int getNumberStudents(){
       return students.size();
    }

    public void showStudents(){
       for(int i = 0; i < students.size(); i++) {
            System.out.println(students.get(i));
       }
    }

    public String getCourseName(){
       return courseName;
    }...

By purchasing this solution you'll be able to access the following files:
Course.java.

$15.00
for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Java Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats