diff --git a/Lab02/.classpath b/Lab02/.classpath
new file mode 100644
index 0000000..9af0373
--- /dev/null
+++ b/Lab02/.classpath
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/Lab02/.project b/Lab02/.project
new file mode 100644
index 0000000..73024b9
--- /dev/null
+++ b/Lab02/.project
@@ -0,0 +1,17 @@
+
+
+ Lab02
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/Lab02/src/lab02/Car.java b/Lab02/src/lab02/Car.java
new file mode 100644
index 0000000..17f8a10
--- /dev/null
+++ b/Lab02/src/lab02/Car.java
@@ -0,0 +1,45 @@
+package lab02;
+
+import javax.swing.JOptionPane;
+
+public class Car {
+ private String brand;
+ private int year;
+ private Fuel fuel;
+
+ public void getBrand() {
+ JOptionPane.showMessageDialog(null, brand);
+ }
+ public void setBrand() {
+ brand = JOptionPane.showInputDialog("Brand = ");
+ }
+
+ public void getYear() {
+ JOptionPane.showMessageDialog(null, year);
+ }
+ public void setYear() {
+ year = Integer.parseInt(JOptionPane.showInputDialog("Year = "));
+ }
+
+ public void getFuel() {
+ JOptionPane.showMessageDialog(null, fuel);
+ }
+ public void setFuel() {
+ Object[] possibilities = {"Diesel", "Petrol"};
+
+ String response = (String)JOptionPane.showInputDialog(null, "Fuel = ", null, JOptionPane.PLAIN_MESSAGE, null, possibilities, "Diesel");
+
+ fuel = Fuel.valueOf(response);
+ }
+
+ public void setAll() {
+ setBrand();
+ setYear();
+ setFuel();
+ }
+
+ @Override
+ public String toString() {
+ return brand + " (" + String.valueOf(year) +") - " + String.valueOf(fuel);
+ }
+}
diff --git a/Lab02/src/lab02/Fuel.java b/Lab02/src/lab02/Fuel.java
new file mode 100644
index 0000000..3f67922
--- /dev/null
+++ b/Lab02/src/lab02/Fuel.java
@@ -0,0 +1,6 @@
+package lab02;
+
+public enum Fuel {
+ Diesel,
+ Petrol
+}
diff --git a/Lab02/src/lab02/Lab02.java b/Lab02/src/lab02/Lab02.java
new file mode 100644
index 0000000..03c5d2d
--- /dev/null
+++ b/Lab02/src/lab02/Lab02.java
@@ -0,0 +1,26 @@
+package lab02;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.JOptionPane;
+
+public class Lab02 {
+
+ public static void main(String[] args) {
+ List cars = new ArrayList();
+
+ int x = Integer.parseInt(JOptionPane.showInputDialog("x = "));
+
+ for(int i = 0; i < x; i++) {
+ Car car = new Car();
+ car.setAll();
+ cars.add(car);
+ }
+
+ for(Car car: cars) {
+ JOptionPane.showMessageDialog(null, car.toString());
+ }
+ }
+
+}