From 4678933c3023adf81875669f997ec5ff35912916 Mon Sep 17 00:00:00 2001 From: "lola.georges" Date: Mon, 6 May 2024 11:31:53 +0200 Subject: [PATCH] clean proj --- LAB1/.project | 2 +- LAB1/src/Keyboard.java | 59 ----------------------------------- LAB1/src/Main.java | 15 --------- LAB1/src/Robot.java | 9 ------ LAB1/src/RobotCalculator.java | 26 --------------- LAB1/src/Test.java | 4 --- 6 files changed, 1 insertion(+), 114 deletions(-) delete mode 100644 LAB1/src/Keyboard.java delete mode 100644 LAB1/src/Main.java delete mode 100644 LAB1/src/Robot.java delete mode 100644 LAB1/src/RobotCalculator.java delete mode 100644 LAB1/src/Test.java diff --git a/LAB1/.project b/LAB1/.project index 721d5a6..1596d3e 100644 --- a/LAB1/.project +++ b/LAB1/.project @@ -1,6 +1,6 @@ - LAB1 + Project_C03_GOL diff --git a/LAB1/src/Keyboard.java b/LAB1/src/Keyboard.java deleted file mode 100644 index ad234c2..0000000 --- a/LAB1/src/Keyboard.java +++ /dev/null @@ -1,59 +0,0 @@ -import java.io.*; - - - -/** - * Class : Keyboard - * Description : The class implements input methods for primitive types from the keyboard. - */ -public class Keyboard { - /** - * Return a String typed on keyboard - * @return : a string - */ - public String readString() { - String sChaine = null; - //System.out.println("Enter a value :"); - try { - // read the value - BufferedReader brLecteur ; - brLecteur = new BufferedReader(new InputStreamReader(System.in)); - sChaine = brLecteur.readLine(); - } - catch (IOException ee) { - System.out.println("Error"); - } - return sChaine; // return the string - } - - /** - * Return an Integer typed on keyboard - * @return : an integer - */ - public int readInt() { - String sChaine = readString(); // call readString - // cast from string to int - return Integer.parseInt(sChaine.trim()); - } - - /** - * Return a float typed on keyboard - * @return : a float - */ - public float readFloat() { - String sChaine = readString(); - // cast from string to float - return Float.parseFloat(sChaine.trim()); - } - - /** - * Return a double typed on keyboard - * @return : a double - */ - public double readDouble() { - String sChaine = readString(); - // cast frome string to double - return Double.parseDouble(sChaine.trim()); - } - -} \ No newline at end of file diff --git a/LAB1/src/Main.java b/LAB1/src/Main.java deleted file mode 100644 index 0ebcbf9..0000000 --- a/LAB1/src/Main.java +++ /dev/null @@ -1,15 +0,0 @@ -public class Main { - public static void main(String[] args) { - - //Robot robo = new Robot(); - //robo.sayHello(); - //robo.sayHello2("Lola"); - -// RobotCalculator robo = new RobotCalculator(); -// robo.average(15.0,5.0); -// RobotCalculator b = new RobotCalculator(); -// b.askUserForNbOfStudent(); - - - } -} \ No newline at end of file diff --git a/LAB1/src/Robot.java b/LAB1/src/Robot.java deleted file mode 100644 index dd54b59..0000000 --- a/LAB1/src/Robot.java +++ /dev/null @@ -1,9 +0,0 @@ -public class Robot { - public void sayHello() { - System.out.println("Hello"); - } - public void sayHello2(String name) { - System.out.println("Hello "+ name); - } - -} \ No newline at end of file diff --git a/LAB1/src/RobotCalculator.java b/LAB1/src/RobotCalculator.java deleted file mode 100644 index ab9e05f..0000000 --- a/LAB1/src/RobotCalculator.java +++ /dev/null @@ -1,26 +0,0 @@ -public class RobotCalculator { - -public double average(double grade1, double grade2) { - double avg = (grade1 + grade2)/2; - return avg; - } - - public void askUserForNbOfStudent() { - System.out.println("Give me the number of student"); - Keyboard input = new Keyboard(); - int nStudents = input.readInt(); - double sum = 0 ; - for(int i=1;i<=nStudents;i++) { - System.out.println("Give me the fisrt grade"); - double grade1 = input.readDouble(); - System.out.println("Give me the second grade"); - double grade2 = input.readDouble(); - RobotCalculator robo = new RobotCalculator(); - double StudentAvg = robo.average(grade1,grade2); - sum = sum + StudentAvg ; - System.out.println(StudentAvg); - } - System.out.println(sum/nStudents); - - } -} \ No newline at end of file diff --git a/LAB1/src/Test.java b/LAB1/src/Test.java deleted file mode 100644 index 3a321b4..0000000 --- a/LAB1/src/Test.java +++ /dev/null @@ -1,4 +0,0 @@ - -public class Test { - -}