diff --git a/lab1/FunctionCalculator/.idea/.gitignore b/lab1/FunctionCalculator/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/lab1/FunctionCalculator/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/lab1/FunctionCalculator/.idea/.name b/lab1/FunctionCalculator/.idea/.name deleted file mode 100644 index 002da1d..0000000 --- a/lab1/FunctionCalculator/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -Main.java \ No newline at end of file diff --git a/lab1/FunctionCalculator/.idea/misc.xml b/lab1/FunctionCalculator/.idea/misc.xml deleted file mode 100644 index 7464918..0000000 --- a/lab1/FunctionCalculator/.idea/misc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/lab1/FunctionCalculator/.idea/modules.xml b/lab1/FunctionCalculator/.idea/modules.xml deleted file mode 100644 index 5092df8..0000000 --- a/lab1/FunctionCalculator/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/lab1/FunctionCalculator/FunctionCalculator.iml b/lab1/FunctionCalculator/FunctionCalculator.iml deleted file mode 100644 index c90834f..0000000 --- a/lab1/FunctionCalculator/FunctionCalculator.iml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/lab1/FunctionCalculator/out/production/FunctionCalculator/Main.class b/lab1/FunctionCalculator/out/production/FunctionCalculator/Main.class deleted file mode 100644 index 920cbb0..0000000 Binary files a/lab1/FunctionCalculator/out/production/FunctionCalculator/Main.class and /dev/null differ diff --git a/lab1/FunctionCalculator/src/Main.java b/lab1/FunctionCalculator/src/Main.java deleted file mode 100644 index bcda6ea..0000000 --- a/lab1/FunctionCalculator/src/Main.java +++ /dev/null @@ -1,51 +0,0 @@ -import java.util.Scanner; -public class Main { - public static void main(String[] args) { - //C2 = 2501 % 2 = 1, і операція O1 буде відніманням (-). - //C3 = 2501 % 3 = 2 - //C5 = 2501 % 5 = 1, і операція O2 буде діленням (/). - //C7 = 2501 % 7 = 4, тип індексів i та j буде char. - double result = 0; // результат - char i, j; - char operation1 = '-'; - double constant = 2.0; - Scanner scanner = new Scanner(System.in); - System.out.print("Введіть значення n: "); - int n = scanner.nextInt(); - System.out.print("Введіть значення m: "); - int m = scanner.nextInt(); - - // Обчислення значення функції S - for (i = 'a'; i <= 'a' + n - 1; i++) { - for (j = 'b'; j <= 'b' + m - 1; j++) { - try { - double value = (double) i / applyOperation(j, operation1, constant); - result += value; - } catch (ArithmeticException e) { - System.out.println("Ділення на нуль: " + e.getMessage()); - } catch (Exception e) { - System.out.println("Виникла помилка: " + e.getMessage()); - } - } - } - - // Виведення результату - System.out.println("Результат: " + result); - } - - // Метод, який застосовує операцію О1 до двох чисел - public static double applyOperation(char j, char operation, double constant) throws Exception { - switch (operation) { - case '-': - return (double) j - constant; - case '/': - if (constant == 0.0) { - throw new ArithmeticException("C не може бути рівним нулю"); - } else { - return (double) j / constant; - } - default: - throw new Exception("Непідтримувана операція: " + operation); - } - } -} \ No newline at end of file diff --git a/lab1/lab1.pdf b/lab1/lab1.pdf deleted file mode 100644 index 3c875e7..0000000 Binary files a/lab1/lab1.pdf and /dev/null differ