Almost done!
This commit is contained in:
parent
701da5eb0e
commit
6fe4d6b982
10
dropbox20/.classpath
Normal file
10
dropbox20/.classpath
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="module" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="src" path=""/>
|
||||||
|
<classpathentry kind="output" path=""/>
|
||||||
|
</classpath>
|
||||||
17
dropbox20/.project
Normal file
17
dropbox20/.project
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>dropbox20</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
||||||
2
dropbox20/.settings/org.eclipse.core.resources.prefs
Normal file
2
dropbox20/.settings/org.eclipse.core.resources.prefs
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
encoding/<project>=UTF-8
|
||||||
4
dropbox20/dropbox20/.gitignore
vendored
Normal file
4
dropbox20/dropbox20/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/Vehicle.class
|
||||||
|
/Car.class
|
||||||
|
/Pickup.class
|
||||||
|
/VehicleTest.class
|
||||||
39
dropbox20/dropbox20/Car.java
Normal file
39
dropbox20/dropbox20/Car.java
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 20
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 07, 2025
|
||||||
|
*/
|
||||||
|
package dropbox20;
|
||||||
|
public class Car extends Vehicle {
|
||||||
|
|
||||||
|
//fields
|
||||||
|
private int seats;
|
||||||
|
|
||||||
|
//accessor
|
||||||
|
public int getSeats() {
|
||||||
|
return seats;
|
||||||
|
}
|
||||||
|
|
||||||
|
//mutator
|
||||||
|
public void setSeats(int seats) {
|
||||||
|
this.seats = seats;
|
||||||
|
}
|
||||||
|
|
||||||
|
//constructor
|
||||||
|
public Car() {
|
||||||
|
}
|
||||||
|
public Car(String make, String model, int year, int seats) {
|
||||||
|
super(make, model, year);
|
||||||
|
this.seats = seats;
|
||||||
|
}
|
||||||
|
|
||||||
|
// toString
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
String str;
|
||||||
|
str = String.format("%s%12s%-10d%n",
|
||||||
|
super.toString(), "seats: ", getSeats());
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
}
|
||||||
37
dropbox20/dropbox20/Pickup.java
Normal file
37
dropbox20/dropbox20/Pickup.java
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 20
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 07, 2025
|
||||||
|
*/
|
||||||
|
package dropbox20;
|
||||||
|
public class Pickup extends Vehicle {
|
||||||
|
|
||||||
|
//fields
|
||||||
|
private int towing;
|
||||||
|
|
||||||
|
//accessor
|
||||||
|
public int getTowing() {
|
||||||
|
return towing;
|
||||||
|
}
|
||||||
|
|
||||||
|
//mutator
|
||||||
|
public void setTowing(int towing) {
|
||||||
|
this.towing = towing;
|
||||||
|
}
|
||||||
|
|
||||||
|
//constructor
|
||||||
|
public Pickup(String make, String model, int year, int towing) {
|
||||||
|
super(make, model, year);
|
||||||
|
this.towing = towing;
|
||||||
|
}
|
||||||
|
|
||||||
|
//ToString
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
String str;
|
||||||
|
str = String.format("%s%11s%-10d%n", super.toString(), "Towing(lB.: ",
|
||||||
|
getTowing());
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
}
|
||||||
69
dropbox20/dropbox20/Vehicle.java
Normal file
69
dropbox20/dropbox20/Vehicle.java
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 20
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 07, 2025
|
||||||
|
*/
|
||||||
|
package dropbox20;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
public class Vehicle {
|
||||||
|
|
||||||
|
//fields
|
||||||
|
private final int WARRANTY_YEAR = 3;
|
||||||
|
private String make;
|
||||||
|
private String model;
|
||||||
|
private int year;
|
||||||
|
|
||||||
|
//accessors
|
||||||
|
public String getMake() {
|
||||||
|
return make;
|
||||||
|
}
|
||||||
|
public String getModel() {
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
public int getYear() {
|
||||||
|
return year;
|
||||||
|
}
|
||||||
|
|
||||||
|
//mutators
|
||||||
|
public void setMake(String make) {
|
||||||
|
this.make = make;
|
||||||
|
}
|
||||||
|
public void setModel(String model) {
|
||||||
|
this.model = model;
|
||||||
|
}
|
||||||
|
public void setYear(int year) {
|
||||||
|
this.year = year;
|
||||||
|
}
|
||||||
|
|
||||||
|
//constructor
|
||||||
|
public Vehicle() {
|
||||||
|
}
|
||||||
|
public Vehicle (String make, String model, int year) {
|
||||||
|
this.make = make;
|
||||||
|
this.model = model;
|
||||||
|
this.year = year;
|
||||||
|
}
|
||||||
|
//method
|
||||||
|
public boolean withinWarranty() {
|
||||||
|
boolean warranty = false;
|
||||||
|
LocalDate currentDate = LocalDate.now();
|
||||||
|
int currentYear = currentDate.getYear();
|
||||||
|
if(currentYear - getYear() <= WARRANTY_YEAR) {
|
||||||
|
warranty = true;
|
||||||
|
}
|
||||||
|
return warranty;
|
||||||
|
}
|
||||||
|
|
||||||
|
// toString
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
String str;
|
||||||
|
str = String.format("%12s%-10s%n%12s%-10s%n%12s%-10s%n%12s%-10s%n",
|
||||||
|
"Make: ", getMake(),
|
||||||
|
"Model: ", getModel(),
|
||||||
|
"Year: ", getYear(),
|
||||||
|
"Warranty: ", withinWarranty()?"Yes":"No");
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
}
|
||||||
15
dropbox20/dropbox20/VehicleTest.java
Normal file
15
dropbox20/dropbox20/VehicleTest.java
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 20
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 07, 2025
|
||||||
|
*/
|
||||||
|
package dropbox20;
|
||||||
|
public class VehicleTest {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Car car = new Car("Honda", "Civic", 2000, 5);
|
||||||
|
System.out.println(car);
|
||||||
|
Pickup pickup = new Pickup("Ford", "F-350", 2023, 8000);
|
||||||
|
System.out.println(pickup);
|
||||||
|
}
|
||||||
|
}
|
||||||
10
dropbox21/.classpath
Normal file
10
dropbox21/.classpath
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="module" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="src" path=""/>
|
||||||
|
<classpathentry kind="output" path=""/>
|
||||||
|
</classpath>
|
||||||
17
dropbox21/.project
Normal file
17
dropbox21/.project
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>dropbox21</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
||||||
2
dropbox21/.settings/org.eclipse.core.resources.prefs
Normal file
2
dropbox21/.settings/org.eclipse.core.resources.prefs
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
encoding/<project>=UTF-8
|
||||||
4
dropbox21/dropbox21/.gitignore
vendored
Normal file
4
dropbox21/dropbox21/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/Book.class
|
||||||
|
/Paperback.class
|
||||||
|
/Digital.class
|
||||||
|
/BookTest.class
|
||||||
80
dropbox21/dropbox21/Book.java
Normal file
80
dropbox21/dropbox21/Book.java
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 21
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 07, 2025
|
||||||
|
*/
|
||||||
|
|
||||||
|
package dropbox21;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
public class Book {
|
||||||
|
|
||||||
|
//fields
|
||||||
|
private boolean NEEDS_UPDATE = false;
|
||||||
|
private String isbn;
|
||||||
|
private String title;
|
||||||
|
private String author;
|
||||||
|
private int copyright_year;
|
||||||
|
|
||||||
|
//accessors
|
||||||
|
public String getISBN() {
|
||||||
|
return isbn;
|
||||||
|
}
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
public String getAuthor() {
|
||||||
|
return author;
|
||||||
|
}
|
||||||
|
public int getCopyright_Year() {
|
||||||
|
return copyright_year;
|
||||||
|
}
|
||||||
|
|
||||||
|
//mutators
|
||||||
|
public void setISBN(String isbn) {
|
||||||
|
this.isbn = isbn;
|
||||||
|
}
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
public void setAuthor(String author) {
|
||||||
|
this.author = author;
|
||||||
|
}
|
||||||
|
public void setCopyright_Year(int copyright_year) {
|
||||||
|
this.copyright_year = copyright_year;
|
||||||
|
}
|
||||||
|
|
||||||
|
//constructor
|
||||||
|
public Book() {
|
||||||
|
}
|
||||||
|
public Book(String isbn, String title, String author, int copyright_year) {
|
||||||
|
this.isbn = isbn;
|
||||||
|
this.title = title;
|
||||||
|
this.author = author;
|
||||||
|
this.copyright_year = copyright_year;
|
||||||
|
}
|
||||||
|
|
||||||
|
//method
|
||||||
|
public boolean needsUpdate() {
|
||||||
|
LocalDate currentDate = LocalDate.now();
|
||||||
|
int currentYear = currentDate.getYear();
|
||||||
|
if(currentYear - getCopyright_Year() > 3) {
|
||||||
|
NEEDS_UPDATE = true;
|
||||||
|
}
|
||||||
|
return NEEDS_UPDATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
// toString
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
String str;
|
||||||
|
str = String.format("%12s%-10s%n%12s%-10s%n%12s%-10s%n%12s%-10s%n%12s%-10s%n",
|
||||||
|
"ISBN: ", getISBN(),
|
||||||
|
"Title: ", getTitle(),
|
||||||
|
"Author: ", getAuthor(),
|
||||||
|
"Copyright: ", getCopyright_Year(),
|
||||||
|
"Update req: ", needsUpdate()?"Yes":"No");
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
}
|
||||||
18
dropbox21/dropbox21/BookTest.java
Normal file
18
dropbox21/dropbox21/BookTest.java
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 21
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 07, 2025
|
||||||
|
*/
|
||||||
|
|
||||||
|
package dropbox21;
|
||||||
|
|
||||||
|
public class BookTest {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Paperback paperback = new Paperback("1234", "Rita Hayworth and Shawshank Redemption", "Stephen King", 2024, 300);
|
||||||
|
System.out.println(paperback);
|
||||||
|
Digital digital = new Digital("4321", "The Andromeda Strain", "Michael Crichton", 1969, 200);
|
||||||
|
System.out.println(digital);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
39
dropbox21/dropbox21/Digital.java
Normal file
39
dropbox21/dropbox21/Digital.java
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 21
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 07, 2025
|
||||||
|
*/
|
||||||
|
|
||||||
|
package dropbox21;
|
||||||
|
|
||||||
|
public class Digital extends Book {
|
||||||
|
|
||||||
|
//fields
|
||||||
|
private double filesize;
|
||||||
|
|
||||||
|
//accessor
|
||||||
|
public double getFileSize() {
|
||||||
|
return filesize;
|
||||||
|
}
|
||||||
|
|
||||||
|
//mutator
|
||||||
|
public void setFileSize(double filesize) {
|
||||||
|
this.filesize = filesize;
|
||||||
|
}
|
||||||
|
|
||||||
|
//constructor
|
||||||
|
public Digital(String isbn, String title, String author, int copyright_year, double filesize) {
|
||||||
|
super(isbn, title, author, copyright_year);
|
||||||
|
this.filesize = filesize;
|
||||||
|
}
|
||||||
|
|
||||||
|
//ToString
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
String str;
|
||||||
|
str = String.format("%s%11s%-10.2f%n", super.toString(), "Size (Kb): ",
|
||||||
|
getFileSize());
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
}
|
||||||
41
dropbox21/dropbox21/Paperback.java
Normal file
41
dropbox21/dropbox21/Paperback.java
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 21
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 07, 2025
|
||||||
|
*/
|
||||||
|
|
||||||
|
package dropbox21;
|
||||||
|
|
||||||
|
public class Paperback extends Book {
|
||||||
|
|
||||||
|
//fields
|
||||||
|
private int pages;
|
||||||
|
|
||||||
|
//accessor
|
||||||
|
public int getPages() {
|
||||||
|
return pages;
|
||||||
|
}
|
||||||
|
|
||||||
|
//mutator
|
||||||
|
public void setPages(int pages) {
|
||||||
|
this.pages = pages;
|
||||||
|
}
|
||||||
|
|
||||||
|
//constructor
|
||||||
|
public Paperback() {
|
||||||
|
}
|
||||||
|
public Paperback(String isbn, String title, String author, int copyright_year, int pages) {
|
||||||
|
super(isbn, title, author, copyright_year);
|
||||||
|
this.pages = pages;
|
||||||
|
}
|
||||||
|
|
||||||
|
// toString
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
String str;
|
||||||
|
str = String.format("%s%12s%-10d%n",
|
||||||
|
super.toString(), "Pages: ", getPages());
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
}
|
||||||
10
dropbox22/.classpath
Normal file
10
dropbox22/.classpath
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="module" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="src" path=""/>
|
||||||
|
<classpathentry kind="output" path=""/>
|
||||||
|
</classpath>
|
||||||
17
dropbox22/.project
Normal file
17
dropbox22/.project
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>dropbox22</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
||||||
2
dropbox22/.settings/org.eclipse.core.resources.prefs
Normal file
2
dropbox22/.settings/org.eclipse.core.resources.prefs
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
encoding/<project>=UTF-8
|
||||||
7
dropbox22/dropbox22/.gitignore
vendored
Normal file
7
dropbox22/dropbox22/.gitignore
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
/Student.class
|
||||||
|
/DomesticStudent.class
|
||||||
|
/InternationalStudent.class
|
||||||
|
/PartitimeStudent.class
|
||||||
|
/Registration.class
|
||||||
|
/ParttimeStudent.class
|
||||||
|
/StudentTest.class
|
||||||
48
dropbox22/dropbox22/DomesticStudent.java
Normal file
48
dropbox22/dropbox22/DomesticStudent.java
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 22
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 08, 2025
|
||||||
|
*/
|
||||||
|
|
||||||
|
package dropbox22;
|
||||||
|
public class DomesticStudent extends Student {
|
||||||
|
|
||||||
|
//field
|
||||||
|
private int ACTScore;
|
||||||
|
|
||||||
|
//accessor
|
||||||
|
public int getACTScore() {
|
||||||
|
return ACTScore;
|
||||||
|
}
|
||||||
|
|
||||||
|
//mutator
|
||||||
|
public void setACTScore(int ACTScore) {
|
||||||
|
if(ACTScore<0 || ACTScore > 36) {
|
||||||
|
throw new IllegalArgumentException("Invalid ACT Score.");
|
||||||
|
}
|
||||||
|
this.ACTScore = ACTScore;
|
||||||
|
}
|
||||||
|
|
||||||
|
//constructor
|
||||||
|
public DomesticStudent() {
|
||||||
|
}
|
||||||
|
public DomesticStudent(String name, int ACTScore) {
|
||||||
|
super(name);
|
||||||
|
if(ACTScore<0 || ACTScore > 36) {
|
||||||
|
throw new IllegalArgumentException("Invalid ACT Score.");
|
||||||
|
}
|
||||||
|
this.ACTScore = ACTScore;
|
||||||
|
this.ACTScore = ACTScore;
|
||||||
|
}
|
||||||
|
|
||||||
|
// method
|
||||||
|
@Override
|
||||||
|
public boolean admissionDecision() {
|
||||||
|
boolean decision = false;
|
||||||
|
if(getACTScore()>= 27) {
|
||||||
|
decision = true;
|
||||||
|
}
|
||||||
|
return decision;
|
||||||
|
}
|
||||||
|
}
|
||||||
44
dropbox22/dropbox22/InternationalStudent.java
Normal file
44
dropbox22/dropbox22/InternationalStudent.java
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 22
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 08, 2025
|
||||||
|
*/
|
||||||
|
|
||||||
|
package dropbox22;
|
||||||
|
public class InternationalStudent extends Student {
|
||||||
|
|
||||||
|
//field
|
||||||
|
private int TOEFLScore;
|
||||||
|
|
||||||
|
//accessor
|
||||||
|
public int getTOEFLScore() {
|
||||||
|
return TOEFLScore;
|
||||||
|
}
|
||||||
|
|
||||||
|
//mutator
|
||||||
|
public void setTOEFLScore(int TOEFLScore) {
|
||||||
|
if(TOEFLScore < 0 || TOEFLScore > 120) {
|
||||||
|
throw new IllegalArgumentException("Invalid TOEFL score.");
|
||||||
|
}
|
||||||
|
this.TOEFLScore = TOEFLScore;
|
||||||
|
}
|
||||||
|
|
||||||
|
//constructor
|
||||||
|
public InternationalStudent(){
|
||||||
|
}
|
||||||
|
public InternationalStudent(String name, int TOEFLScore) {
|
||||||
|
super(name);
|
||||||
|
setTOEFLScore(TOEFLScore);
|
||||||
|
}
|
||||||
|
|
||||||
|
// method
|
||||||
|
@Override
|
||||||
|
public boolean admissionDecision() {
|
||||||
|
boolean decision = false;
|
||||||
|
if(getTOEFLScore() >= 75) {
|
||||||
|
decision = true;
|
||||||
|
}
|
||||||
|
return decision;
|
||||||
|
}
|
||||||
|
}
|
||||||
53
dropbox22/dropbox22/ParttimeStudent.java
Normal file
53
dropbox22/dropbox22/ParttimeStudent.java
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 22
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 08, 2025
|
||||||
|
*/
|
||||||
|
|
||||||
|
package dropbox22;
|
||||||
|
public class ParttimeStudent extends DomesticStudent implements Registration {
|
||||||
|
|
||||||
|
//constructor
|
||||||
|
public ParttimeStudent() {
|
||||||
|
}
|
||||||
|
public ParttimeStudent(String name, int ACTScore) {
|
||||||
|
super(name, ACTScore);
|
||||||
|
}
|
||||||
|
|
||||||
|
// method
|
||||||
|
@Override
|
||||||
|
public boolean admissionDecision() {
|
||||||
|
boolean decision = false;
|
||||||
|
if(getACTScore() >= 25) {
|
||||||
|
decision = true;
|
||||||
|
}
|
||||||
|
return decision;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkPreRequisite() {
|
||||||
|
if(admissionDecision()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String addClass() {
|
||||||
|
String result;
|
||||||
|
if(checkPreRequisite()) {
|
||||||
|
result = "Class added.";
|
||||||
|
} else {
|
||||||
|
result = "Cannot add class at this time.";
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
String str;
|
||||||
|
str = String.format("%s%s%n", super.toString(), addClass());
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
}
|
||||||
18
dropbox22/dropbox22/Registration.java
Normal file
18
dropbox22/dropbox22/Registration.java
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 22
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 08, 2025
|
||||||
|
*/
|
||||||
|
|
||||||
|
package dropbox22;
|
||||||
|
public interface Registration {
|
||||||
|
|
||||||
|
//fields
|
||||||
|
int parttimeMaxHours = 6;
|
||||||
|
int fulltimeMaxHours = 18;
|
||||||
|
|
||||||
|
//method
|
||||||
|
boolean checkPreRequisite();
|
||||||
|
String addClass();
|
||||||
|
}
|
||||||
43
dropbox22/dropbox22/Student.java
Normal file
43
dropbox22/dropbox22/Student.java
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 22
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 08, 2025
|
||||||
|
*/
|
||||||
|
|
||||||
|
package dropbox22;
|
||||||
|
public abstract class Student {
|
||||||
|
|
||||||
|
//fields
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
//accessors
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
//mutator
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Constructor
|
||||||
|
protected Student() {
|
||||||
|
}
|
||||||
|
protected Student (String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
//method
|
||||||
|
public abstract boolean admissionDecision();
|
||||||
|
|
||||||
|
//toString
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
String str;
|
||||||
|
str = String.format("Student name: %s%n%s%n",
|
||||||
|
getName(), admissionDecision()?
|
||||||
|
"Congratulations.": "Thank you and best wishes.");
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
}
|
||||||
24
dropbox22/dropbox22/StudentTest.java
Normal file
24
dropbox22/dropbox22/StudentTest.java
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 22
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 08, 2025
|
||||||
|
*/
|
||||||
|
|
||||||
|
package dropbox22;
|
||||||
|
public class StudentTest {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
DomesticStudent domestic =
|
||||||
|
new DomesticStudent("John Doe", 35);
|
||||||
|
System.out.println(domestic);
|
||||||
|
|
||||||
|
InternationalStudent international =
|
||||||
|
new InternationalStudent("Aarav Anand", 70);
|
||||||
|
System.out.println(international);
|
||||||
|
|
||||||
|
ParttimeStudent parttime =
|
||||||
|
new ParttimeStudent("Vivaan Alex", 26);
|
||||||
|
System.out.println(parttime);
|
||||||
|
}
|
||||||
|
}
|
||||||
10
dropbox23/.classpath
Normal file
10
dropbox23/.classpath
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="module" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="src" path=""/>
|
||||||
|
<classpathentry kind="output" path=""/>
|
||||||
|
</classpath>
|
||||||
17
dropbox23/.project
Normal file
17
dropbox23/.project
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>dropbox23</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
||||||
2
dropbox23/.settings/org.eclipse.core.resources.prefs
Normal file
2
dropbox23/.settings/org.eclipse.core.resources.prefs
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
encoding/<project>=UTF-8
|
||||||
6
dropbox23/dropbox23/.gitignore
vendored
Normal file
6
dropbox23/dropbox23/.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
/Employee.class
|
||||||
|
/Full_Time.class
|
||||||
|
/Part_Time.class
|
||||||
|
/Commission_Based.class
|
||||||
|
/Minimum_Wage.class
|
||||||
|
/Employee_Test.class
|
||||||
49
dropbox23/dropbox23/Commission_Based.java
Normal file
49
dropbox23/dropbox23/Commission_Based.java
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 23
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 08, 2025
|
||||||
|
*/
|
||||||
|
|
||||||
|
package dropbox23;
|
||||||
|
|
||||||
|
public class Commission_Based extends Part_Time implements Minimum_Wage {
|
||||||
|
|
||||||
|
//field
|
||||||
|
private double weekly_sales;
|
||||||
|
private double commission_rate;
|
||||||
|
|
||||||
|
//accessor
|
||||||
|
public double getWeekly_Sales() {
|
||||||
|
return weekly_sales;
|
||||||
|
}
|
||||||
|
public double getCommission_Rate() {
|
||||||
|
return commission_rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
//mutator
|
||||||
|
public void setWeekly_Sales(double weekly_sales) {
|
||||||
|
this.weekly_sales = weekly_sales;
|
||||||
|
}
|
||||||
|
public void setCommission_Rate(double commission_rate) {
|
||||||
|
this.commission_rate = commission_rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
//constructor
|
||||||
|
public Commission_Based(String name, java.time.LocalDate hire_date, int hours_worked, double hourly_rate, double weekly_sales, double commission_rate) {
|
||||||
|
super(name, hire_date, hours_worked, hourly_rate);
|
||||||
|
setWeekly_Sales(weekly_sales);
|
||||||
|
setCommission_Rate(commission_rate);
|
||||||
|
this.weekly_rate = (hours_worked * hourly_rate) + (weekly_sales * commission_rate);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double weekly_pay() {
|
||||||
|
return weekly_rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean metMinimum() {
|
||||||
|
return weekly_rate / getHours_Worked() >= minimum;
|
||||||
|
}
|
||||||
|
}
|
||||||
53
dropbox23/dropbox23/Employee.java
Normal file
53
dropbox23/dropbox23/Employee.java
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 23
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 08, 2025
|
||||||
|
*/
|
||||||
|
|
||||||
|
package dropbox23;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
public abstract class Employee {
|
||||||
|
|
||||||
|
//fields
|
||||||
|
private String name;
|
||||||
|
private LocalDate hire_date;
|
||||||
|
protected double weekly_pay;
|
||||||
|
|
||||||
|
//accessors
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
public LocalDate getHire_Date() {
|
||||||
|
return hire_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
//mutator
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
public void setHire_Date(LocalDate hire_date) {
|
||||||
|
this.hire_date = hire_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Constructor
|
||||||
|
protected Employee() {
|
||||||
|
}
|
||||||
|
protected Employee(String name, LocalDate hire_date) {
|
||||||
|
this.name = name;
|
||||||
|
this.hire_date = hire_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
//method
|
||||||
|
public abstract double weekly_pay();
|
||||||
|
|
||||||
|
//toString
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
String str;
|
||||||
|
str = String.format("Employee name: %s%n Hire Date: %s%n",
|
||||||
|
getName(), getHire_Date());
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
}
|
||||||
61
dropbox23/dropbox23/Employee_Test.java
Normal file
61
dropbox23/dropbox23/Employee_Test.java
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 23
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 08, 2025
|
||||||
|
*/
|
||||||
|
|
||||||
|
package dropbox23;
|
||||||
|
|
||||||
|
public class Employee_Test {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
//fill per example
|
||||||
|
|
||||||
|
Full_Time full_time_1 =
|
||||||
|
new Full_Time("John Doe", java.time.LocalDate.of(2023, 1, 15), 60000);
|
||||||
|
Part_Time part_time_1 =
|
||||||
|
new Part_Time("Jane Smith", java.time.LocalDate.of(2023, 2, 5), 20, 15.00);
|
||||||
|
Commission_Based commission_employee_1 =
|
||||||
|
new Commission_Based("Mike Johnson", java.time.LocalDate.of(2023, 3, 10), 40, 5.00, 1000, 0.05);
|
||||||
|
Commission_Based commission_employee_2 =
|
||||||
|
new Commission_Based("Sarah Davis", java.time.LocalDate.of(2023, 4, 20), 40, 5.00, 100000, 0.05);
|
||||||
|
|
||||||
|
//dump per example
|
||||||
|
|
||||||
|
System.out.println("Full-Time Employee:");
|
||||||
|
System.out.println("- Name: " + full_time_1.getName());
|
||||||
|
System.out.println("- Hire Date: " + full_time_1.getHire_Date());
|
||||||
|
System.out.printf("- Weekly Pay: $%.2f%n%n", full_time_1.weekly_pay());
|
||||||
|
|
||||||
|
System.out.println("Part-Time Employee:");
|
||||||
|
System.out.println("- Name: " + part_time_1.getName());
|
||||||
|
System.out.println("- Hire Date: " + part_time_1.getHire_Date());
|
||||||
|
System.out.printf("- Weekly Pay: $%.2f%n", part_time_1.weekly_pay());
|
||||||
|
System.out.println("- Hours Worked: " + part_time_1.getHours_Worked());
|
||||||
|
System.out.println("- Hourly Rate: $" + part_time_1.getHourly_Rate());
|
||||||
|
System.out.println();
|
||||||
|
|
||||||
|
System.out.println("Commission Employee 1:");
|
||||||
|
System.out.println("- Name: " + commission_employee_1.getName());
|
||||||
|
System.out.println("- Hire Date: " + commission_employee_1.getHire_Date());
|
||||||
|
System.out.printf("- Weekly Pay: $%.2f%n", commission_employee_1.weekly_pay());
|
||||||
|
System.out.println("- Hours Worked: " + commission_employee_1.getHours_Worked());
|
||||||
|
System.out.println("- Hourly Base Rate: $" + commission_employee_1.getHourly_Rate());
|
||||||
|
System.out.println("- Weekly Sales Amount: $" + commission_employee_1.getWeekly_Sales());
|
||||||
|
System.out.println("- Commission Rate: " + commission_employee_1.getCommission_Rate());
|
||||||
|
System.out.println("- Meet state minimum wage: " + commission_employee_1.metMinimum());
|
||||||
|
System.out.println();
|
||||||
|
|
||||||
|
System.out.println("Commission Employee 2:");
|
||||||
|
System.out.println("- Name: " + commission_employee_2.getName());
|
||||||
|
System.out.println("- Hire Date: " + commission_employee_2.getHire_Date());
|
||||||
|
System.out.printf("- Weekly Pay: $%.2f%n", commission_employee_2.weekly_pay());
|
||||||
|
System.out.println("- Hours Worked: " + commission_employee_2.getHours_Worked());
|
||||||
|
System.out.println("- Hourly Base Rate: $" + commission_employee_2.getHourly_Rate());
|
||||||
|
System.out.println("- Weekly Sales Amount: $" + commission_employee_2.getWeekly_Sales());
|
||||||
|
System.out.println("- Commission Rate: " + commission_employee_2.getCommission_Rate());
|
||||||
|
System.out.println("- Meet state minimum wage: " + commission_employee_2.metMinimum());
|
||||||
|
System.out.println();
|
||||||
|
}
|
||||||
|
}
|
||||||
43
dropbox23/dropbox23/Full_Time.java
Normal file
43
dropbox23/dropbox23/Full_Time.java
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 23
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 08, 2025
|
||||||
|
*/
|
||||||
|
|
||||||
|
package dropbox23;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
public class Full_Time extends Employee{
|
||||||
|
|
||||||
|
//field
|
||||||
|
private double annual_salary;
|
||||||
|
protected double weekly_rate;
|
||||||
|
|
||||||
|
//accessor
|
||||||
|
public double getAnnual_Salary() {
|
||||||
|
return annual_salary;
|
||||||
|
}
|
||||||
|
public double getWeekly_Rate() {
|
||||||
|
return weekly_rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
//mutator
|
||||||
|
public void setAnnual_Salary(double annual_salary) {
|
||||||
|
this.annual_salary = annual_salary;
|
||||||
|
}
|
||||||
|
|
||||||
|
//constructor
|
||||||
|
public Full_Time() {
|
||||||
|
}
|
||||||
|
public Full_Time(String name, LocalDate hire_date, double annual_salary) {
|
||||||
|
super(name, hire_date);
|
||||||
|
setAnnual_Salary(annual_salary);
|
||||||
|
this.weekly_rate = annual_salary / 52;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double weekly_pay() {
|
||||||
|
return weekly_rate;
|
||||||
|
}
|
||||||
|
}
|
||||||
17
dropbox23/dropbox23/Minimum_Wage.java
Normal file
17
dropbox23/dropbox23/Minimum_Wage.java
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 23
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 08, 2025
|
||||||
|
*/
|
||||||
|
|
||||||
|
package dropbox23;
|
||||||
|
|
||||||
|
public interface Minimum_Wage {
|
||||||
|
|
||||||
|
//fields
|
||||||
|
double minimum = 12.00;
|
||||||
|
|
||||||
|
//method
|
||||||
|
boolean metMinimum();
|
||||||
|
}
|
||||||
53
dropbox23/dropbox23/Part_Time.java
Normal file
53
dropbox23/dropbox23/Part_Time.java
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 23
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 08, 2025
|
||||||
|
*/
|
||||||
|
|
||||||
|
package dropbox23;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
public class Part_Time extends Employee {
|
||||||
|
|
||||||
|
//field
|
||||||
|
private int hours_worked;
|
||||||
|
private double hourly_rate;
|
||||||
|
protected double weekly_rate;
|
||||||
|
|
||||||
|
//accessor
|
||||||
|
public int getHours_Worked() {
|
||||||
|
return hours_worked;
|
||||||
|
}
|
||||||
|
public double getHourly_Rate() {
|
||||||
|
return hourly_rate;
|
||||||
|
}
|
||||||
|
public double getWeekly_Rate() {
|
||||||
|
return weekly_rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
//mutator
|
||||||
|
public void setHours_Worked(int hours_worked) {
|
||||||
|
this.hours_worked = hours_worked;
|
||||||
|
}
|
||||||
|
public void setHourly_Rate(double hourly_rate) {
|
||||||
|
this.hourly_rate = hourly_rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
//constructor
|
||||||
|
public Part_Time(){
|
||||||
|
}
|
||||||
|
public Part_Time(String name, LocalDate hire_date, int hours_worked, double hourly_rate) {
|
||||||
|
super(name, hire_date);
|
||||||
|
setHours_Worked(hours_worked);
|
||||||
|
setHourly_Rate(hourly_rate);
|
||||||
|
this.weekly_rate = hours_worked * hourly_rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double weekly_pay() {
|
||||||
|
return weekly_rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
82
dropbox23/dropbox23/instructions.org
Normal file
82
dropbox23/dropbox23/instructions.org
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
#+title: Instructions
|
||||||
|
|
||||||
|
* Exercise 6.3
|
||||||
|
|
||||||
|
** There are two types of employees at Tiny Manufacture LLC:
|
||||||
|
*** full-time employees
|
||||||
|
*** part-time employees.
|
||||||
|
**** A commission-based employee is a type of part-time employee.
|
||||||
|
|
||||||
|
** A full-time employee
|
||||||
|
*** name
|
||||||
|
*** hire date
|
||||||
|
*** annual salary
|
||||||
|
*** method for calculating their weekly pay, based on 52 weeks per year.
|
||||||
|
|
||||||
|
** A part-time employee
|
||||||
|
*** name
|
||||||
|
*** hire date
|
||||||
|
*** current week's hours worked
|
||||||
|
*** hourly rate
|
||||||
|
*** method for calculating their weekly pay
|
||||||
|
**** weekly pay = current week's hours worked × hourly rate.
|
||||||
|
|
||||||
|
** Commission-based employee
|
||||||
|
*** Weekly sales amount
|
||||||
|
*** Commission rate
|
||||||
|
*** Weekly pay calculated
|
||||||
|
**** weekly pay = current week's hours worked × hourly rate + weekly sales amount × commission rate.
|
||||||
|
|
||||||
|
** The weekly pay method in the Employee class needs to be declared as abstract.
|
||||||
|
|
||||||
|
** Create an interface called MinimumWage.
|
||||||
|
*** State minimum hourly wage
|
||||||
|
*** Method named metMinimum
|
||||||
|
**** returns true if the wage meets the minimum requirement.
|
||||||
|
*** The commission-based employee class must implement the MinimumWage interface.
|
||||||
|
|
||||||
|
** Create a class called EmployeeTest
|
||||||
|
*** main() method
|
||||||
|
**** used to test the different employee classes.
|
||||||
|
*** Create an objects
|
||||||
|
**** full-time employee
|
||||||
|
**** part-time employee.
|
||||||
|
*** Create two objects for commission-based employees
|
||||||
|
**** one that meets the state minimum wage
|
||||||
|
**** and another that does not.
|
||||||
|
*** Use the provided employee data from the sample output below.
|
||||||
|
*** Display the details of all the employees.
|
||||||
|
|
||||||
|
* Sample output:
|
||||||
|
|
||||||
|
Full-Time Employee:
|
||||||
|
- Name: John Doe
|
||||||
|
- Hire Date: 2023-01-15
|
||||||
|
- Weekly Pay: $1153.85
|
||||||
|
|
||||||
|
Part-Time Employee:
|
||||||
|
- Name: Jane Smith
|
||||||
|
- Hire Date: 2023-02-05
|
||||||
|
- Weekly Pay: $300.00
|
||||||
|
- Hours Worked: 20.0
|
||||||
|
- Hourly Rate: $15.00
|
||||||
|
|
||||||
|
Commission Employee 1:
|
||||||
|
- Name: Mike Johnson
|
||||||
|
- Hire Date: 2023-03-10
|
||||||
|
- Weekly Pay: $250.00
|
||||||
|
- Hours Worked: 40.0
|
||||||
|
- Hourly Base Rate: $5.00
|
||||||
|
- Weekly Sales Amount: $1,000.00
|
||||||
|
- Commission Rate: 0.05
|
||||||
|
- Meet state minimum wage: False
|
||||||
|
|
||||||
|
Commission Employee 2:
|
||||||
|
- Name: Sarah Davis
|
||||||
|
- Hire Date: 2023-04-20
|
||||||
|
- Weekly Pay: $700.00
|
||||||
|
- Hours Worked: 40.0
|
||||||
|
- Hourly Base Rate: $5.00
|
||||||
|
- Weekly Sales Amount: $100,000.00
|
||||||
|
- Commission Rate: 0.05
|
||||||
|
- Meet state minimum wage: True
|
||||||
10
dropbox23_bak/.classpath
Normal file
10
dropbox23_bak/.classpath
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="module" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="src" path=""/>
|
||||||
|
<classpathentry kind="output" path=""/>
|
||||||
|
</classpath>
|
||||||
17
dropbox23_bak/.project
Normal file
17
dropbox23_bak/.project
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>dropbox23</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
||||||
2
dropbox23_bak/.settings/org.eclipse.core.resources.prefs
Normal file
2
dropbox23_bak/.settings/org.eclipse.core.resources.prefs
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
encoding/<project>=UTF-8
|
||||||
6
dropbox23_bak/dropbox23/.gitignore
vendored
Normal file
6
dropbox23_bak/dropbox23/.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
/Employee.class
|
||||||
|
/Full_Time.class
|
||||||
|
/Part_Time.class
|
||||||
|
/Commission_Based.class
|
||||||
|
/Minimum_Wage.class
|
||||||
|
/Employee_Test.class
|
||||||
42
dropbox23_bak/dropbox23/Commission_Based.java
Normal file
42
dropbox23_bak/dropbox23/Commission_Based.java
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 23
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 08, 2025
|
||||||
|
*/
|
||||||
|
|
||||||
|
package dropbox23;
|
||||||
|
|
||||||
|
public class Commission_Based extends Part_Time{
|
||||||
|
|
||||||
|
//field
|
||||||
|
private double weekly_sales;
|
||||||
|
private double commission_rate;
|
||||||
|
|
||||||
|
//accessor
|
||||||
|
public double getWeekly_Sales() {
|
||||||
|
return weekly_sales;
|
||||||
|
}
|
||||||
|
public double getCommission_Rate() {
|
||||||
|
return commission_rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
//mutator
|
||||||
|
public void setWeekly_Sales(double weekly_sales) {
|
||||||
|
this.weekly_sales = weekly_sales;
|
||||||
|
}
|
||||||
|
public void setCommission_Rate(double commission_rate) {
|
||||||
|
this.commission_rate = commission_rate;
|
||||||
|
}
|
||||||
|
private void setWeekly_Rate(int hours_worked, double hourly_rate, double weekly_sales, double commission_rate) {
|
||||||
|
this.weekly_rate = (hours_worked * hourly_rate) + (weekly_sales * commission_rate);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean meetMinimum() {
|
||||||
|
if(minimum > this.weekly_pay) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
54
dropbox23_bak/dropbox23/Employee.java
Normal file
54
dropbox23_bak/dropbox23/Employee.java
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 23
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 08, 2025
|
||||||
|
*/
|
||||||
|
|
||||||
|
package dropbox23;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
public abstract class Employee {
|
||||||
|
|
||||||
|
//fields
|
||||||
|
private String name;
|
||||||
|
private LocalDate hire_date;
|
||||||
|
|
||||||
|
//accessors
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
public LocalDate getHire_Date() {
|
||||||
|
return hire_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
//mutator
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
public void setHire_Date(LocalDate hire_date) {
|
||||||
|
this.hire_date = hire_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Constructor
|
||||||
|
protected Employee() {
|
||||||
|
}
|
||||||
|
protected Employee(String name, LocalDate hire_date) {
|
||||||
|
this.name = name;
|
||||||
|
this.hire_date = hire_date;
|
||||||
|
}
|
||||||
|
|
||||||
|
//method
|
||||||
|
public abstract boolean meets_minimum_wage();
|
||||||
|
public abstract double weekly_pay();
|
||||||
|
|
||||||
|
//toString
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
String str;
|
||||||
|
str = String.format("Employee name: %s%n%s%n%s%n",
|
||||||
|
getName(), getHire_Date(), meets_minimum_wage()?
|
||||||
|
"Minimum wage meet.": "Minimum wage not meet.");
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
}
|
||||||
25
dropbox23_bak/dropbox23/Employee_Test.java
Normal file
25
dropbox23_bak/dropbox23/Employee_Test.java
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 23
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 08, 2025
|
||||||
|
*/
|
||||||
|
|
||||||
|
package dropbox23;
|
||||||
|
|
||||||
|
public class Employee_Test {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
Full_Time full_time_1 =
|
||||||
|
new Full_Time("John Doe", 2023-01-15, 1153.85);
|
||||||
|
System.out.println(full_time_1);
|
||||||
|
|
||||||
|
// InternationalStudent international =
|
||||||
|
// new InternationalStudent("Aarav Anand", 70);
|
||||||
|
// System.out.println(international);
|
||||||
|
|
||||||
|
// ParttimeStudent parttime =
|
||||||
|
// new ParttimeStudent("Vivaan Alex", 26);
|
||||||
|
// System.out.println(parttime);
|
||||||
|
|
||||||
|
}
|
||||||
37
dropbox23_bak/dropbox23/Full_Time.java
Normal file
37
dropbox23_bak/dropbox23/Full_Time.java
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 23
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 08, 2025
|
||||||
|
*/
|
||||||
|
|
||||||
|
package dropbox23;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
public class Full_Time extends Employee{
|
||||||
|
|
||||||
|
//field
|
||||||
|
private double annual_salary;
|
||||||
|
|
||||||
|
//accessor
|
||||||
|
public double getAnnual_Salary() {
|
||||||
|
return annual_salary;
|
||||||
|
}
|
||||||
|
|
||||||
|
//mutator
|
||||||
|
public void setAnnual_Salary(double annual_salary) {
|
||||||
|
this.annual_salary = annual_salary;
|
||||||
|
}
|
||||||
|
private void setWeekly_Rate(double annual_salary) {
|
||||||
|
this.weekly_rate = annual_salary / 52;
|
||||||
|
}
|
||||||
|
|
||||||
|
//constructor
|
||||||
|
public Full_Time() {
|
||||||
|
}
|
||||||
|
public Full_Time(String name, LocalDate hire_date, double annual_salary) {
|
||||||
|
super(name, hire_date);
|
||||||
|
setAnnual_Salary(annual_salary);
|
||||||
|
setWeekly_Rate(annual_salary);
|
||||||
|
}
|
||||||
|
}
|
||||||
17
dropbox23_bak/dropbox23/Minimum_Wage.java
Normal file
17
dropbox23_bak/dropbox23/Minimum_Wage.java
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 23
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 08, 2025
|
||||||
|
*/
|
||||||
|
|
||||||
|
package dropbox23;
|
||||||
|
|
||||||
|
public interface Minimum_Wage {
|
||||||
|
|
||||||
|
//fields
|
||||||
|
double minimum = 12.00;
|
||||||
|
|
||||||
|
//method
|
||||||
|
boolean metMinimum();
|
||||||
|
}
|
||||||
47
dropbox23_bak/dropbox23/Part_Time.java
Normal file
47
dropbox23_bak/dropbox23/Part_Time.java
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
/**
|
||||||
|
* Assignment 23
|
||||||
|
* Skill: CISS238
|
||||||
|
* Student: Scott Steely
|
||||||
|
* Date: Oct 08, 2025
|
||||||
|
*/
|
||||||
|
|
||||||
|
package dropbox23;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
public class Part_Time extends Employee {
|
||||||
|
|
||||||
|
//field
|
||||||
|
private int hours_worked;
|
||||||
|
private double hourly_rate;
|
||||||
|
|
||||||
|
//accessor
|
||||||
|
public int getHours_Worked() {
|
||||||
|
return hours_worked;
|
||||||
|
}
|
||||||
|
public double getHourly_Rate() {
|
||||||
|
return hourly_rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
//mutator
|
||||||
|
public void setHours_Worked(int hours_worked) {
|
||||||
|
this.hours_worked = hours_worked;
|
||||||
|
}
|
||||||
|
public void setHourly_Rate(double hourly_rate) {
|
||||||
|
this.hourly_rate = hourly_rate;
|
||||||
|
}
|
||||||
|
private void setWeekly_Rate(int hours_worked, double hourly_rate) {
|
||||||
|
this.weekly_rate = hours_worked * hourly_rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
//constructor
|
||||||
|
public Part_Time(){
|
||||||
|
}
|
||||||
|
public Part_Time(String name, LocalDate hire_date, int hours_worked, double hourly_rate) {
|
||||||
|
super(name, hire_date);
|
||||||
|
setHours_Worked(hours_worked);
|
||||||
|
setHourly_Rate(hourly_rate);
|
||||||
|
setWeekly_Rate(hours_worked, hourly_rate);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user