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

8
Source Code/Assignment2/.idea/.gitignore generated vendored Normal file
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/../../../../../:\JavaProjects\JavaYear1\Assignment2\.idea/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

View File

@ -0,0 +1,25 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<JetCodeStyleSettings>
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
<value>
<package name="java.util" alias="false" withSubpackages="false" />
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
<package name="io.ktor" alias="false" withSubpackages="true" />
</value>
</option>
<option name="PACKAGES_IMPORT_LAYOUT">
<value>
<package name="" alias="false" withSubpackages="true" />
<package name="java" alias="false" withSubpackages="true" />
<package name="javax" alias="false" withSubpackages="true" />
<package name="kotlin" alias="false" withSubpackages="true" />
<package name="" alias="true" withSubpackages="true" />
</value>
</option>
</JetCodeStyleSettings>
<ScalaCodeStyleSettings>
<option name="MULTILINE_STRING_CLOSING_QUOTES_ON_NEW_LINE" value="true" />
</ScalaCodeStyleSettings>
</code_scheme>
</component>

View File

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>

6
Source Code/Assignment2/.idea/misc.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Assignment2.iml" filepath="$PROJECT_DIR$/Assignment2.iml" />
</modules>
</component>
</project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/info/ExampleFiles" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

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

Binary file not shown.

View File

@ -0,0 +1,40 @@
/**
This class represents a Course.
@author Leah Bidlake
@author Isaac Shoebottom (3429069)
*/
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 final String name;
private final String semester;
private final String instructor;
private final int year;
private int students;
//The constructor creates a new Course object and initializes the
//instance variables.
public Course(String nameIn, String semesterIn, String instructorIn, int yearIn){
this.name = nameIn;
this.semester = semesterIn;
this.instructor = instructorIn;
this.year = yearIn;
this.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 Output(){ //Maybe don't overwrite the base "toString method???"
return name + " offered " + semester + " " + year + ". Taught By: " + instructor + ". Students: " + students;
}
public void addStudents(int students) {
this.students += students;
}
}

View File

@ -0,0 +1,45 @@
/**
This is an example of a driver class; its purpose
is to try out the Course class.
@author Leah Bidlake
@author Isaac Shoebottom (3429069)
*/
public class CourseDriver{
public static void main(String[] args){
//Create some Course objects
Course course1 = new Course("CS1073", "Fall", "Mr. Don Clement",2020);
Course course2 = new Course("CS1083", "Winter", "Dr. Harvey Ingrid",2021);
Course course3 = new Course("MATH1013", "Summer", "Mrs. Lee Smith" ,2021);
Course course4 = new Course("ENG1104", "Fall", "Ms. Kate Free", 2022);
/* Add the appropriate statements to record the fact that 23 students have
been added to CS1073, 17 students have been added to CS1083, and 31
students have been added to MATH1013. Then, provide another
statement to record the fact that 14 more students have been added to
CS1073. Position these four statements after the objects are created and
before they are printed out. */
course1.addStudents(23);
course2.addStudents(17);
course3.addStudents(31);
course1.addStudents(14);
System.out.println("23 students have been added to CS1073");
System.out.println("17 students have been added to CS1083");
System.out.println("31 students have been added to MATH1013");
System.out.println("14 students have been added to CS1073");
//Now I can print out my courses to confirm they
//were created properly
System.out.println("course1: " + course1.Output());
System.out.println("course2: " + course2.Output());
System.out.println("course3: " + course3.Output());
System.out.println("course4: " + course4.Output());
}
}