Assignment 1
Assignment 1
// Constructor
public Invoice(String partNumber, String partDescription, int quantity,
double pricePerItem) {
this.partNumber = partNumber;
this.partDescription = partDescription;
setQuantity(quantity); // Validate and set quantity
setPricePerItem(pricePerItem); // Validate and set price per item
}
Question 2:
// Constructor
public Employee(String firstName, String lastName, double monthlySalary) {
this.firstName = firstName;
this.lastName = lastName;
setMonthlySalary(monthlySalary); // Validate and set monthly salary
}