diff --git a/Appointment P9.3/.idea/.gitignore b/Appointment P9.3/.idea/.gitignore
new file mode 100644
index 0000000..26d3352
--- /dev/null
+++ b/Appointment P9.3/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/Appointment P9.3/.idea/misc.xml b/Appointment P9.3/.idea/misc.xml
new file mode 100644
index 0000000..03f397c
--- /dev/null
+++ b/Appointment P9.3/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Appointment P9.3/.idea/modules.xml b/Appointment P9.3/.idea/modules.xml
new file mode 100644
index 0000000..e767f47
--- /dev/null
+++ b/Appointment P9.3/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Appointment P9.3/.idea/uiDesigner.xml b/Appointment P9.3/.idea/uiDesigner.xml
new file mode 100644
index 0000000..2b63946
--- /dev/null
+++ b/Appointment P9.3/.idea/uiDesigner.xml
@@ -0,0 +1,124 @@
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/Appointment P9.3/.idea/vcs.xml b/Appointment P9.3/.idea/vcs.xml
new file mode 100644
index 0000000..6c0b863
--- /dev/null
+++ b/Appointment P9.3/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Appointment P9.3/Appointment P9.3.iml b/Appointment P9.3/Appointment P9.3.iml
new file mode 100644
index 0000000..c90834f
--- /dev/null
+++ b/Appointment P9.3/Appointment P9.3.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Appointment P9.3/src/Appointment.java b/Appointment P9.3/src/Appointment.java
new file mode 100644
index 0000000..e113154
--- /dev/null
+++ b/Appointment P9.3/src/Appointment.java
@@ -0,0 +1,22 @@
+public class Appointment {
+ private final String description;
+ private final int day;
+ private final int month;
+ private final int year;
+
+ public Appointment(String description, int day, int month, int year) {
+ this.description = description;
+ this.day = day;
+ this.month = month;
+ this.year = year;
+ }
+
+ public boolean occursOn(int day, int month, int year) {
+ return (this.day == day && this.month == month && this.year == year);
+ }
+
+ @Override
+ public String toString() {
+ return "Appuntamento " + this.getClass().getName() + " {" + description + " il " + day + "/" + month + "/" + year + '}';
+ }
+}
\ No newline at end of file
diff --git a/Appointment P9.3/src/Daily.java b/Appointment P9.3/src/Daily.java
new file mode 100644
index 0000000..a332b1d
--- /dev/null
+++ b/Appointment P9.3/src/Daily.java
@@ -0,0 +1,11 @@
+public class Daily extends Appointment {
+
+ public Daily(String description, int day, int month, int year) {
+ super(description, day, month, year);
+ }
+
+ @Override
+ public boolean occursOn(int day, int month, int year) {
+ return super.occursOn(day + 1, month, year);
+ }
+}
\ No newline at end of file
diff --git a/Appointment P9.3/src/Monthly.java b/Appointment P9.3/src/Monthly.java
new file mode 100644
index 0000000..68154e2
--- /dev/null
+++ b/Appointment P9.3/src/Monthly.java
@@ -0,0 +1,11 @@
+public class Monthly extends Appointment {
+
+ public Monthly(String description, int day, int month, int year) {
+ super(description, day, month, year);
+ }
+
+ @Override
+ public boolean occursOn(int day, int month, int year) {
+ return super.occursOn(day, month + 1, year);
+ }
+}
\ No newline at end of file
diff --git a/Appointment P9.3/src/OneTime.java b/Appointment P9.3/src/OneTime.java
new file mode 100644
index 0000000..8041e5f
--- /dev/null
+++ b/Appointment P9.3/src/OneTime.java
@@ -0,0 +1,6 @@
+public class OneTime extends Appointment {
+
+ public OneTime(String description, int day, int month, int year) {
+ super(description, day, month, year);
+ }
+}
diff --git a/Appointment P9.3/src/Tester.java b/Appointment P9.3/src/Tester.java
new file mode 100644
index 0000000..95bb618
--- /dev/null
+++ b/Appointment P9.3/src/Tester.java
@@ -0,0 +1,13 @@
+import java.util.ArrayList;
+
+public class Tester {
+
+ public static void main(String[] args) {
+ ArrayList agenda= new ArrayList<>();
+
+ agenda.add(new OneTime("Dentista", 24, 3, 22));
+
+ System.out.println(agenda.toString());
+ System.out.println(agenda.get(0).occursOn(24, 3, 22));
+ }
+}
diff --git a/Sort.java b/Sort.java
new file mode 100644
index 0000000..f13f060
--- /dev/null
+++ b/Sort.java
@@ -0,0 +1,23 @@
+import java.util.Arrays;
+
+public class Sort {
+ public static void main(String[] args) {
+ Integer[] a = {7, 4, 3, 1, 5, 10, 4};
+ Sort.selectionSort(a);
+ System.out.println(Arrays.toString(a));
+ }
+
+ public static void selectionSort(T[] a) {
+ for(int i = 0; i < a.length - 1; i++) {
+ int posMin = i;
+ for(int j = i+1; j < a.length; j++) {
+ if(a[j].compareTo(a[posMin]) < 0) posMin = j;
+ }
+ if(posMin != i) {
+ T tmp = a[i];
+ a[i] = a[posMin];
+ a[posMin] = tmp;
+ }
+ }
+ }
+}