Skip to content

Commit

Permalink
Fic: added 3 missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed committed Mar 14, 2024
1 parent b48d11e commit 14e49db
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package com.codedifferently.lesson7.mohamedobjects.main;

public class Part {
String name;
int releaseYear;
String brand;

public Part() {}

public Part(String name, int releaseYear, String brand) {
this.name = name;
checkValidYear(releaseYear);
this.releaseYear = releaseYear;
this.brand = brand;
}

public void setBrand(String brand) {
this.brand = brand;
}

public void setName(String name) {
this.name = name;
}

public void setReleaseYear(int releaseYear) {
checkValidYear(releaseYear);
this.releaseYear = releaseYear;
}

public String getBrand() {
return brand;
}

public String getName() {
return name;
}

public int getReleaseYear() {
return releaseYear;
}

public boolean checkValidYear(int year) {
if (year <= 2024 && year >= 2000) {
return true;
} else {
throw new IllegalYearExeption("Year is out of expected range. 2000 - 2024");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.codedifferently.lesson7.mohamedobjects.main;

public enum cpuBrand {
AMD,
INTEL,
APPLE
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.codedifferently.lesson7.mohamedobjects.main;

public enum portType {
VGA,
DVI,
HDMI,
DP
}

0 comments on commit 14e49db

Please sign in to comment.