From f9d1fa4ada371e00595242e5082d75d03d93c962 Mon Sep 17 00:00:00 2001 From: bwortman2 <35316840+bwortman2@users.noreply.github.com> Date: Wed, 7 Feb 2018 18:27:59 -0600 Subject: [PATCH 1/4] Create ben wortman --- Ben Wortman/ben wortman | 1 + 1 file changed, 1 insertion(+) create mode 100644 Ben Wortman/ben wortman diff --git a/Ben Wortman/ben wortman b/Ben Wortman/ben wortman new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/Ben Wortman/ben wortman @@ -0,0 +1 @@ + From 24b4569cf377c3a02fd6fd0dda8e6d267271a891 Mon Sep 17 00:00:00 2001 From: bwortman2 <35316840+bwortman2@users.noreply.github.com> Date: Wed, 7 Feb 2018 18:28:14 -0600 Subject: [PATCH 2/4] Add files via upload --- Ben Wortman/BW Lab-2.java | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Ben Wortman/BW Lab-2.java diff --git a/Ben Wortman/BW Lab-2.java b/Ben Wortman/BW Lab-2.java new file mode 100644 index 0000000..9083abf --- /dev/null +++ b/Ben Wortman/BW Lab-2.java @@ -0,0 +1,26 @@ + + + + +public class Problem2{ + + int num = 1579; //starting number + System.out.println("The number is " + num); //says the starting number + + for(i=0; number>1; i++) //add one per loop + + {if (num % 2==0) //if the number is divisible by 2 is a whole number + { num = num/2; //then divide the number by 2 + System.out.println("The current number is " +num);} //prints number after divided by 2 + + else {num = num*3+1; //if not divisible by 2 multiply by 3 and add 1 + + System.out.println("The current number is " +num)}} //prints the number after multiplied by 3 and one added + + System.out.println("There were" +i " operations")} //prints how many times was a number sent through before it was 1 + + + + + + \ No newline at end of file From bfde863b49290199ad04ba0618d83ac8656c9ecc Mon Sep 17 00:00:00 2001 From: bwortman2 <35316840+bwortman2@users.noreply.github.com> Date: Wed, 7 Feb 2018 18:28:31 -0600 Subject: [PATCH 3/4] Delete ben wortman --- Ben Wortman/ben wortman | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Ben Wortman/ben wortman diff --git a/Ben Wortman/ben wortman b/Ben Wortman/ben wortman deleted file mode 100644 index 8b13789..0000000 --- a/Ben Wortman/ben wortman +++ /dev/null @@ -1 +0,0 @@ - From 2fb2095a515593a075b89cbbf01c9dca8d07ee50 Mon Sep 17 00:00:00 2001 From: bwortman2 <35316840+bwortman2@users.noreply.github.com> Date: Wed, 7 Feb 2018 18:30:37 -0600 Subject: [PATCH 4/4] Update BW Lab-2.java --- Ben Wortman/BW Lab-2.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Ben Wortman/BW Lab-2.java b/Ben Wortman/BW Lab-2.java index 9083abf..6623a79 100644 --- a/Ben Wortman/BW Lab-2.java +++ b/Ben Wortman/BW Lab-2.java @@ -4,16 +4,16 @@ public class Problem2{ - int num = 1579; //starting number - System.out.println("The number is " + num); //says the starting number + int num = 1579; //starting number + System.out.println("The number is " + num); //says the starting number - for(i=0; number>1; i++) //add one per loop + for(i=0; number>1; i++) //add one per loop - {if (num % 2==0) //if the number is divisible by 2 is a whole number - { num = num/2; //then divide the number by 2 + {if (num % 2==0) //if the number is divisible by 2 is a whole number + { num = num/2; //then divide the number by 2 System.out.println("The current number is " +num);} //prints number after divided by 2 - else {num = num*3+1; //if not divisible by 2 multiply by 3 and add 1 + else {num = num*3+1; //if not divisible by 2 multiply by 3 and add 1 System.out.println("The current number is " +num)}} //prints the number after multiplied by 3 and one added @@ -23,4 +23,4 @@ public class Problem2{ - \ No newline at end of file +