From 34238da29732fee7bbceaa74a883662d0df5447d Mon Sep 17 00:00:00 2001 From: vaishnavirshah Date: Sun, 1 Oct 2023 10:38:01 -0400 Subject: [PATCH 1/4] added min max java file --- src/MinMaxCalculation.java | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/MinMaxCalculation.java diff --git a/src/MinMaxCalculation.java b/src/MinMaxCalculation.java new file mode 100644 index 00000000..b01274aa --- /dev/null +++ b/src/MinMaxCalculation.java @@ -0,0 +1,8 @@ +/* + * + * + * min max calculation + * + * + * + */ \ No newline at end of file From df8d45b174c2f1c6bd0b2649670f561329562e35 Mon Sep 17 00:00:00 2001 From: shreyabirthare Date: Tue, 3 Oct 2023 00:32:10 -0400 Subject: [PATCH 2/4] Updated README.md file --- README.md | 4 ++++ src/MinMaxCalculation.java | 8 ++++++++ 2 files changed, 12 insertions(+) create mode 100644 src/MinMaxCalculation.java diff --git a/README.md b/README.md index ca10b1a7..d136e601 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +# Updated README.md + +Use the below instructions for refrence + # Basic Statistics Basic Statistics is a Java-based implementation for computing statistics on a set of numbers. diff --git a/src/MinMaxCalculation.java b/src/MinMaxCalculation.java new file mode 100644 index 00000000..b01274aa --- /dev/null +++ b/src/MinMaxCalculation.java @@ -0,0 +1,8 @@ +/* + * + * + * min max calculation + * + * + * + */ \ No newline at end of file From 0f4c419b8fd33da8767300185d968896dd69b9da Mon Sep 17 00:00:00 2001 From: shreyabirthare Date: Tue, 3 Oct 2023 00:41:50 -0400 Subject: [PATCH 3/4] Revert "Merge branch 'master' of https://github.com/vaishnavirshah/ie1-basic-stats" This reverts commit 1ec7e0ac0ee98078e11141d59777ccf4962c9c79, reversing changes made to 34238da29732fee7bbceaa74a883662d0df5447d. --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index d136e601..ca10b1a7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,3 @@ -# Updated README.md - -Use the below instructions for refrence - # Basic Statistics Basic Statistics is a Java-based implementation for computing statistics on a set of numbers. From d5d28fb019fbb57ccd916e1ce8cbac5cfd6a9fac Mon Sep 17 00:00:00 2001 From: vaishnavirshah Date: Tue, 3 Oct 2023 07:20:21 -0400 Subject: [PATCH 4/4] updated MinMaxCalculation.java --- src/MinMaxCalculation.java | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/MinMaxCalculation.java b/src/MinMaxCalculation.java index b01274aa..30e80dc5 100644 --- a/src/MinMaxCalculation.java +++ b/src/MinMaxCalculation.java @@ -1,8 +1,20 @@ -/* - * - * - * min max calculation - * - * - * - */ \ No newline at end of file +public class MinMaxCalculation { + public static void main(String[] args) { + int[] numbers = { 10, 5, 8, 20, 3 }; + + int min = numbers[0]; + int max = numbers[0]; + + for (int i = 1; i < numbers.length; i++) { + if (numbers[i] < min) { + min = numbers[i]; + } + if (numbers[i] > max) { + max = numbers[i]; + } + } + + System.out.println("Minimum: " + min); + System.out.println("Maximum: " + max); + } +}