diff --git a/dropbox20/.classpath b/dropbox20/.classpath new file mode 100644 index 0000000..64c0023 --- /dev/null +++ b/dropbox20/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dropbox20/.project b/dropbox20/.project new file mode 100644 index 0000000..9f2643d --- /dev/null +++ b/dropbox20/.project @@ -0,0 +1,17 @@ + + + dropbox20 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/dropbox20/.settings/org.eclipse.core.resources.prefs b/dropbox20/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/dropbox20/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/dropbox20/dropbox20/.gitignore b/dropbox20/dropbox20/.gitignore new file mode 100644 index 0000000..c9aff13 --- /dev/null +++ b/dropbox20/dropbox20/.gitignore @@ -0,0 +1,4 @@ +/Vehicle.class +/Car.class +/Pickup.class +/VehicleTest.class diff --git a/dropbox20/dropbox20/Car.java b/dropbox20/dropbox20/Car.java new file mode 100644 index 0000000..3906a60 --- /dev/null +++ b/dropbox20/dropbox20/Car.java @@ -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; + } +} diff --git a/dropbox20/dropbox20/Pickup.java b/dropbox20/dropbox20/Pickup.java new file mode 100644 index 0000000..48726ff --- /dev/null +++ b/dropbox20/dropbox20/Pickup.java @@ -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; + } +} diff --git a/dropbox20/dropbox20/Vehicle.java b/dropbox20/dropbox20/Vehicle.java new file mode 100644 index 0000000..c8b07c8 --- /dev/null +++ b/dropbox20/dropbox20/Vehicle.java @@ -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; + } +} diff --git a/dropbox20/dropbox20/VehicleTest.java b/dropbox20/dropbox20/VehicleTest.java new file mode 100644 index 0000000..eaba48c --- /dev/null +++ b/dropbox20/dropbox20/VehicleTest.java @@ -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); + } +} diff --git a/dropbox21/.classpath b/dropbox21/.classpath new file mode 100644 index 0000000..64c0023 --- /dev/null +++ b/dropbox21/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dropbox21/.project b/dropbox21/.project new file mode 100644 index 0000000..4849e7a --- /dev/null +++ b/dropbox21/.project @@ -0,0 +1,17 @@ + + + dropbox21 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/dropbox21/.settings/org.eclipse.core.resources.prefs b/dropbox21/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/dropbox21/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/dropbox21/dropbox21/.gitignore b/dropbox21/dropbox21/.gitignore new file mode 100644 index 0000000..a389e0a --- /dev/null +++ b/dropbox21/dropbox21/.gitignore @@ -0,0 +1,4 @@ +/Book.class +/Paperback.class +/Digital.class +/BookTest.class diff --git a/dropbox21/dropbox21/Book.java b/dropbox21/dropbox21/Book.java new file mode 100644 index 0000000..88747e2 --- /dev/null +++ b/dropbox21/dropbox21/Book.java @@ -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; + } +} diff --git a/dropbox21/dropbox21/BookTest.java b/dropbox21/dropbox21/BookTest.java new file mode 100644 index 0000000..7b8aa1e --- /dev/null +++ b/dropbox21/dropbox21/BookTest.java @@ -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); + } + +} diff --git a/dropbox21/dropbox21/Digital.java b/dropbox21/dropbox21/Digital.java new file mode 100644 index 0000000..8488f41 --- /dev/null +++ b/dropbox21/dropbox21/Digital.java @@ -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; + } +} diff --git a/dropbox21/dropbox21/Paperback.java b/dropbox21/dropbox21/Paperback.java new file mode 100644 index 0000000..0f30499 --- /dev/null +++ b/dropbox21/dropbox21/Paperback.java @@ -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; + } +} diff --git a/dropbox22/.classpath b/dropbox22/.classpath new file mode 100644 index 0000000..64c0023 --- /dev/null +++ b/dropbox22/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dropbox22/.project b/dropbox22/.project new file mode 100644 index 0000000..6ce846c --- /dev/null +++ b/dropbox22/.project @@ -0,0 +1,17 @@ + + + dropbox22 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/dropbox22/.settings/org.eclipse.core.resources.prefs b/dropbox22/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/dropbox22/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/dropbox22/dropbox22/.gitignore b/dropbox22/dropbox22/.gitignore new file mode 100644 index 0000000..e33228c --- /dev/null +++ b/dropbox22/dropbox22/.gitignore @@ -0,0 +1,7 @@ +/Student.class +/DomesticStudent.class +/InternationalStudent.class +/PartitimeStudent.class +/Registration.class +/ParttimeStudent.class +/StudentTest.class diff --git a/dropbox22/dropbox22/DomesticStudent.java b/dropbox22/dropbox22/DomesticStudent.java new file mode 100644 index 0000000..1974065 --- /dev/null +++ b/dropbox22/dropbox22/DomesticStudent.java @@ -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; + } +} diff --git a/dropbox22/dropbox22/InternationalStudent.java b/dropbox22/dropbox22/InternationalStudent.java new file mode 100644 index 0000000..fb3bf57 --- /dev/null +++ b/dropbox22/dropbox22/InternationalStudent.java @@ -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; + } +} diff --git a/dropbox22/dropbox22/ParttimeStudent.java b/dropbox22/dropbox22/ParttimeStudent.java new file mode 100644 index 0000000..1b081e5 --- /dev/null +++ b/dropbox22/dropbox22/ParttimeStudent.java @@ -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; + } +} diff --git a/dropbox22/dropbox22/Registration.java b/dropbox22/dropbox22/Registration.java new file mode 100644 index 0000000..593452a --- /dev/null +++ b/dropbox22/dropbox22/Registration.java @@ -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(); +} diff --git a/dropbox22/dropbox22/Student.java b/dropbox22/dropbox22/Student.java new file mode 100644 index 0000000..e1ed830 --- /dev/null +++ b/dropbox22/dropbox22/Student.java @@ -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; + } +} diff --git a/dropbox22/dropbox22/StudentTest.java b/dropbox22/dropbox22/StudentTest.java new file mode 100644 index 0000000..8f75ee0 --- /dev/null +++ b/dropbox22/dropbox22/StudentTest.java @@ -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); + } +} diff --git a/dropbox23/.classpath b/dropbox23/.classpath new file mode 100644 index 0000000..64c0023 --- /dev/null +++ b/dropbox23/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dropbox23/.project b/dropbox23/.project new file mode 100644 index 0000000..fe77e74 --- /dev/null +++ b/dropbox23/.project @@ -0,0 +1,17 @@ + + + dropbox23 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/dropbox23/.settings/org.eclipse.core.resources.prefs b/dropbox23/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/dropbox23/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/dropbox23/dropbox23/.gitignore b/dropbox23/dropbox23/.gitignore new file mode 100644 index 0000000..475d84d --- /dev/null +++ b/dropbox23/dropbox23/.gitignore @@ -0,0 +1,6 @@ +/Employee.class +/Full_Time.class +/Part_Time.class +/Commission_Based.class +/Minimum_Wage.class +/Employee_Test.class diff --git a/dropbox23/dropbox23/Commission_Based.java b/dropbox23/dropbox23/Commission_Based.java new file mode 100644 index 0000000..436481e --- /dev/null +++ b/dropbox23/dropbox23/Commission_Based.java @@ -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; + } +} diff --git a/dropbox23/dropbox23/Employee.java b/dropbox23/dropbox23/Employee.java new file mode 100644 index 0000000..2a410d1 --- /dev/null +++ b/dropbox23/dropbox23/Employee.java @@ -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; + } +} diff --git a/dropbox23/dropbox23/Employee_Test.java b/dropbox23/dropbox23/Employee_Test.java new file mode 100644 index 0000000..f944619 --- /dev/null +++ b/dropbox23/dropbox23/Employee_Test.java @@ -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(); + } +} diff --git a/dropbox23/dropbox23/Full_Time.java b/dropbox23/dropbox23/Full_Time.java new file mode 100644 index 0000000..6deec58 --- /dev/null +++ b/dropbox23/dropbox23/Full_Time.java @@ -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; + } +} diff --git a/dropbox23/dropbox23/Minimum_Wage.java b/dropbox23/dropbox23/Minimum_Wage.java new file mode 100644 index 0000000..5e1819a --- /dev/null +++ b/dropbox23/dropbox23/Minimum_Wage.java @@ -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(); +} diff --git a/dropbox23/dropbox23/Part_Time.java b/dropbox23/dropbox23/Part_Time.java new file mode 100644 index 0000000..4e757b5 --- /dev/null +++ b/dropbox23/dropbox23/Part_Time.java @@ -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; + } + +} diff --git a/dropbox23/dropbox23/instructions.org b/dropbox23/dropbox23/instructions.org new file mode 100644 index 0000000..1025872 --- /dev/null +++ b/dropbox23/dropbox23/instructions.org @@ -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 diff --git a/dropbox23_bak/.classpath b/dropbox23_bak/.classpath new file mode 100644 index 0000000..64c0023 --- /dev/null +++ b/dropbox23_bak/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dropbox23_bak/.project b/dropbox23_bak/.project new file mode 100644 index 0000000..fe77e74 --- /dev/null +++ b/dropbox23_bak/.project @@ -0,0 +1,17 @@ + + + dropbox23 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/dropbox23_bak/.settings/org.eclipse.core.resources.prefs b/dropbox23_bak/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/dropbox23_bak/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/dropbox23_bak/dropbox23/.gitignore b/dropbox23_bak/dropbox23/.gitignore new file mode 100644 index 0000000..475d84d --- /dev/null +++ b/dropbox23_bak/dropbox23/.gitignore @@ -0,0 +1,6 @@ +/Employee.class +/Full_Time.class +/Part_Time.class +/Commission_Based.class +/Minimum_Wage.class +/Employee_Test.class diff --git a/dropbox23_bak/dropbox23/Commission_Based.java b/dropbox23_bak/dropbox23/Commission_Based.java new file mode 100644 index 0000000..23171f5 --- /dev/null +++ b/dropbox23_bak/dropbox23/Commission_Based.java @@ -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; + } +} diff --git a/dropbox23_bak/dropbox23/Employee.java b/dropbox23_bak/dropbox23/Employee.java new file mode 100644 index 0000000..fae48b2 --- /dev/null +++ b/dropbox23_bak/dropbox23/Employee.java @@ -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; + } +} diff --git a/dropbox23_bak/dropbox23/Employee_Test.java b/dropbox23_bak/dropbox23/Employee_Test.java new file mode 100644 index 0000000..93686d4 --- /dev/null +++ b/dropbox23_bak/dropbox23/Employee_Test.java @@ -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); + +} diff --git a/dropbox23_bak/dropbox23/Full_Time.java b/dropbox23_bak/dropbox23/Full_Time.java new file mode 100644 index 0000000..b36f5c6 --- /dev/null +++ b/dropbox23_bak/dropbox23/Full_Time.java @@ -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); + } +} diff --git a/dropbox23_bak/dropbox23/Minimum_Wage.java b/dropbox23_bak/dropbox23/Minimum_Wage.java new file mode 100644 index 0000000..5e1819a --- /dev/null +++ b/dropbox23_bak/dropbox23/Minimum_Wage.java @@ -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(); +} diff --git a/dropbox23_bak/dropbox23/Part_Time.java b/dropbox23_bak/dropbox23/Part_Time.java new file mode 100644 index 0000000..ef68fba --- /dev/null +++ b/dropbox23_bak/dropbox23/Part_Time.java @@ -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); + } + +}