Initial Commit

This commit is contained in:
2022-10-07 00:22:46 -03:00
commit bdcf6d3e1c
465 changed files with 15466 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,37 @@
/**
This class represents a Course.
@author Leah Bidlake
*/
public class Course{
//Instance variables:
//For each Course object, store its name, semester, year, and the
//number of students enrolled in the course so far.
private String name;
private String semester;
private int year;
private int students;
//The constructor creates a new Course object and initializes the
//instance variables.
public Course(String nameIn, String semesterIn, int yearIn){
name = nameIn;
semester = semesterIn;
year = yearIn;
students = 0; //no students have been added to the course
}
//This is a method that we can call on a Course object
//(Specifically, it is an accessor method). This method
//creates and returns a String containing all the information
//about the state of the object.
public String toString(){
return name +
" offered " + semester +
" " + year +
" Students: " + students;
}
}

View File

@ -0,0 +1,25 @@
/**
This is an example of a driver class; its purpose
is to try out the Course class.
@author Leah Bidlake
*/
public class CourseDriver{
public static void main(String[] args){
//Create some Course objects
Course course1 = new Course("CS1073", "Fall", 2020);
Course course2 = new Course("CS1083", "Winter", 2021);
Course course3 = new Course("MATH1013", "Summer", 2021);
//Now I can print out my courses to confirm they
//were created properly
System.out.println("course1: " + course1.toString());
System.out.println("course2: " + course2.toString());
System.out.println("course3: " + course3.toString());
}
}

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,37 @@
/**
This class represents a Course.
@author Leah Bidlake
*/
public class Course{
//Instance variables:
//For each Course object, store its name, semester, year, and the
//number of students enrolled in the course so far.
private String name;
private String semester;
private int year;
private int students;
//The constructor creates a new Course object and initializes the
//instance variables.
public Course(String nameIn, String semesterIn, int yearIn){
name = nameIn;
semester = semesterIn;
year = yearIn;
students = 0; //no students have been added to the course
}
//This is a method that we can call on a Course object
//(Specifically, it is an accessor method). This method
//creates and returns a String containing all the information
//about the state of the object.
public String toString(){
return name +
" offered " + semester +
" " + year +
" Students: " + students;
}
}

View File

@ -0,0 +1,25 @@
/**
This is an example of a driver class; its purpose
is to try out the Course class.
@author Leah Bidlake
*/
public class CourseDriver{
public static void main(String[] args){
//Create some Course objects
Course course1 = new Course("CS1073", "Fall", 2020);
Course course2 = new Course("CS1083", "Winter", 2021);
Course course3 = new Course("MATH1013", "Summer", 2021);
//Now I can print out my courses to confirm they
//were created properly
System.out.println("course1: " + course1.toString());
System.out.println("course2: " + course2.toString());
System.out.println("course3: " + course3.toString());
}
}

View File

@ -0,0 +1,3 @@
course1: CS1073 offered Fall 2020 Students: 0
course2: CS1083 offered Winter 2021 Students: 0
course3: MATH1013 offered Summer 2021 Students: 0