diff --git a/.all-contributorsrc b/.all-contributorsrc index 4342ac5d..19c4e069 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -328,6 +328,15 @@ "doc", "code" ] + }, + { + "login": "thefluffyoshi", + "name": "Katie", + "avatar_url": "https://avatars0.githubusercontent.com/u/54290315?v=4", + "profile": "https://github.com/thefluffyoshi", + "contributions": [ + "code" + ] } ], "commitConvention": "none" diff --git a/BONUS/Arrays/Arrays.iml b/BONUS/Arrays/Arrays.iml new file mode 100644 index 00000000..526e649f --- /dev/null +++ b/BONUS/Arrays/Arrays.iml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BONUS/Misc/Misc.iml b/BONUS/Misc/Misc.iml new file mode 100644 index 00000000..15b04d77 --- /dev/null +++ b/BONUS/Misc/Misc.iml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BONUS/Recursion/Recursion.iml b/BONUS/Recursion/Recursion.iml new file mode 100644 index 00000000..e3ffe152 --- /dev/null +++ b/BONUS/Recursion/Recursion.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BONUS/Strings/Strings.iml b/BONUS/Strings/Strings.iml new file mode 100644 index 00000000..4c73fede --- /dev/null +++ b/BONUS/Strings/Strings.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 39699d08..d9a9dcc5 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -49,6 +49,7 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
GAURAV KUMAR

📖 💻
wboccard

📖 💻
d-l-mcbride

📖 💻 +
Katie

💻 diff --git a/Day1/Day1.iml b/Day1/Day1.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/Day1/Day1.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Day1/Java/FizzBuzz_thefluffyoshi.java b/Day1/Java/FizzBuzz_thefluffyoshi.java new file mode 100644 index 00000000..4e6f3f91 --- /dev/null +++ b/Day1/Java/FizzBuzz_thefluffyoshi.java @@ -0,0 +1,40 @@ +/* + * @author thefluffyoshi + * date: 31/10/2020 + */ + +import java.util.Scanner; + +public class FizzBuzz_thefluffyoshi +{ + public static void main (String[] args) + { + //Variables + int num, i; + + //Input a num + System.out.print("Enter a number: "); + Scanner scan = new Scanner(System.in); + num = scan.nextInt(); + + //Checking inputted num + for (i = 1; i < num; i++) + { + //Checking if num is divisible by both 5 and 3 + if (i%15 == 0) + { + System.out.print("Fizzbuzz" + " "); + }//end FizzBuzz if + //Checking if num is divisible by 5 + else if (i%5 == 0) + { + System.out.print("Buzz" + " "); + }//end Buzz else if + //Checking if num is divisible by 3 + else if (i%3 == 0) + { + System.out.print("Fizz" + " "); + }//end Fizz if + }//end for loop checking + }//end main +}//end class FizzBuzz \ No newline at end of file diff --git a/Day1/README.md b/Day1/README.md index 7ddf0e28..d048f756 100644 --- a/Day1/README.md +++ b/Day1/README.md @@ -180,6 +180,50 @@ public class FizzBuzz_wb { } ``` +### [Solution 4](./Java/FizzBuzz_thefluffyoshi.java) +```java +/* + * @author thefluffyoshi + * date: 31/10/2020 + */ + +import java.util.Scanner; + +public class FizzBuzz_thefluffyoshi +{ + public static void main (String[] args) + { + //Variables + int num, i; + + //Input a num + System.out.print("Enter a number: "); + Scanner scan = new Scanner(System.in); + num = scan.nextInt(); + + //Checking inputted num + for (i = 1; i < num; i++) + { + //Checking if num is divisible by both 5 and 3 + if (i%15 == 0) + { + System.out.print("Fizzbuzz" + " "); + }//end FizzBuzz if + //Checking if num is divisible by 5 + else if (i%5 == 0) + { + System.out.print("Buzz" + " "); + }//end Buzz else if + //Checking if num is divisible by 3 + else if (i%3 == 0) + { + System.out.print("Fizz" + " "); + }//end Fizz if + }//end for loop checking + }//end main +}//end class FizzBuzz +``` + ## C Implementation ### [Fizzbuzz.c](./C/fizzbuzz.c) diff --git a/Day2/Day2.iml b/Day2/Day2.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/Day2/Day2.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Day2/Java/Palindrome_thefluffyoshi.java b/Day2/Java/Palindrome_thefluffyoshi.java new file mode 100644 index 00000000..e09d7122 --- /dev/null +++ b/Day2/Java/Palindrome_thefluffyoshi.java @@ -0,0 +1,37 @@ +/* + * @author thefluffyoshi + * date: 30/10/2020 + */ + +import java.util.Scanner; + +public class Palindrome_thefluffyoshi +{ + public static void main (String[] args) + { + //Instantiating variables + String str_reverse = ""; + + //Input word + System.out.print("Please input the word you want to check: "); + Scanner input = new Scanner(System.in); + String str = input.next(); + + //Reversing the inputted word + for (int i = str.length() - 1; i >= 0; i--) + { + str_reverse = str_reverse + str.charAt(i); + }//end for loop reversal + + //Checking if inputted word is equal/the same as the reverse + if (str_reverse.equals(str)) + { + System.out.println("true"); + } + else + { + System.out.println("false"); + } + + }//end main +}//end Palindrome class \ No newline at end of file diff --git a/Day2/README.md b/Day2/README.md index c0743faf..16718113 100644 --- a/Day2/README.md +++ b/Day2/README.md @@ -328,6 +328,46 @@ class PalindromeCheckTest { } ``` +### [Solution by @thefluffyoshi](./Java/Palindrome_thefluffyoshi.java) +```java +/* + * @author thefluffyoshi + * date: 30/10/2020 + */ + +import java.util.Scanner; + +public class Palindrome_thefluffyoshi +{ + public static void main (String[] args) + { + //Instantiating variables + String str_reverse = ""; + + //Input word + System.out.print("Please input the word you want to check: "); + Scanner input = new Scanner(System.in); + String str = input.next(); + + //Reversing the inputted word + for (int i = str.length() - 1; i >= 0; i--) + { + str_reverse = str_reverse + str.charAt(i); + }//end for loop reversal + + //Checking if inputted word is equal/the same as the reverse + if (str_reverse.equals(str)) + { + System.out.println("true"); + } + else + { + System.out.println("false"); + } + + }//end main +}//end Palindrome class +``` ## C++ Implementation diff --git a/Day3/Day3.iml b/Day3/Day3.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/Day3/Day3.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day10/day10.iml b/day10/day10.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day10/day10.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day11/day11.iml b/day11/day11.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day11/day11.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day12/day12.iml b/day12/day12.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day12/day12.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day13/day13.iml b/day13/day13.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day13/day13.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day14/day14.iml b/day14/day14.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day14/day14.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day15/day15.iml b/day15/day15.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day15/day15.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day16/day16.iml b/day16/day16.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day16/day16.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day17/day17.iml b/day17/day17.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day17/day17.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day18/day18.iml b/day18/day18.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day18/day18.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day19/day19.iml b/day19/day19.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day19/day19.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day20/day20.iml b/day20/day20.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day20/day20.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day22/day22.iml b/day22/day22.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day22/day22.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day24/day24.iml b/day24/day24.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day24/day24.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day25/day25.iml b/day25/day25.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day25/day25.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day28/Java/linearSearch_thefluffyoshi.java b/day28/Java/linearSearch_thefluffyoshi.java new file mode 100644 index 00000000..fb0d68dc --- /dev/null +++ b/day28/Java/linearSearch_thefluffyoshi.java @@ -0,0 +1,52 @@ +/* + * @author thefluffyoshi + * date: 31/10/2020 + */ + +import java.util.Scanner; + +public class linearSearch_thefluffyoshi +{ + public static void main(String []args) + { + //vars + int arr_size, i, searchnum, storeNum = -2; + + //Array size + System.out.print("Enter an array size: "); + Scanner arr_scan = new Scanner(System.in); + arr_size = arr_scan.nextInt(); + + //Storing the size into an array + int array[] = new int[arr_size]; + + //Putting in the array elements based on the size of the array + for (i = 0; i < arr_size; i++) + { + System.out.print("Enter the elements inside the array: "); + array[i] = arr_scan.nextInt(); + }//end input elements inside array + + //Specific element/number to be found in the array + System.out.print("Enter element to be found: "); + searchnum = arr_scan.nextInt(); + for (i = 0; i < arr_size; i++) + { + if (array[i] == searchnum) + { + storeNum = i; + break; + }//end searching for specific num + }//end for loop to search + + //Confirmation if specific element is inside array or not and at what position instead of index + if (storeNum != -2) + { + System.out.println("Output at position: " + storeNum + 1); + }//end comparing if storeNum was changed + else + { + System.out.println("Output: undefined"); + }//end if storeNum stayed the same + }//end main +}//end linearSearch class diff --git a/day28/README.md b/day28/README.md index 5d266d6b..598e140c 100644 --- a/day28/README.md +++ b/day28/README.md @@ -75,6 +75,64 @@ public class linearSearch1 { } ``` +### [Solution by thefluffyoshi](./Java/linearSearch_thefluffyoshi.java) +```java +/* + * @author thefluffyoshi + * date: 31/10/2020 + */ + +import java.util.Scanner; + +public class linearSearch_thefluffyoshi +{ + public static void main(String []args) + { + //vars + int arr_size, i, searchnum, storeNum = -2; + + //Array size + System.out.print("Enter an array size: "); + Scanner arr_scan = new Scanner(System.in); + arr_size = arr_scan.nextInt(); + + //Storing the size into an array + int array[] = new int[arr_size]; + + //Putting in the array elements based on the size of the array + for (i = 0; i < arr_size; i++) + { + System.out.print("Enter the elements inside the array: "); + array[i] = arr_scan.nextInt(); + }//end input elements inside array + + //Specific element/number to be found in the array + System.out.print("Enter element to be found: "); + searchnum = arr_scan.nextInt(); + for (i = 0; i < arr_size; i++) + { + if (array[i] == searchnum) + { + storeNum = i; + break; + }//end searching for specific num + }//end for loop to search + + //Confirmation if specific element is inside array or not and at what position instead of index + if (storeNum != -2) + { + System.out.println("Output at position: " + storeNum + 1); + }//end comparing if storeNum was changed + else + { + System.out.println("Output: undefined"); + }//end if storeNum stayed the same + }//end main +}//end linearSearch class + + +``` + ## C++ Implementation ### [Solution](./C++/linearSearch.cpp) diff --git a/day28/day28.iml b/day28/day28.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day28/day28.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day29/day29.iml b/day29/day29.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day29/day29.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day30/day30.iml b/day30/day30.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day30/day30.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day31/Java/bubbleSort_thefluffyoshi.java b/day31/Java/bubbleSort_thefluffyoshi.java new file mode 100644 index 00000000..1364daf5 --- /dev/null +++ b/day31/Java/bubbleSort_thefluffyoshi.java @@ -0,0 +1,50 @@ +/* + * @author thefluffyoshi + * date: 31/10/2020 + */ + +import java.util.Scanner; + +public class bubbleSort_thefluffyoshi +{ + public static void main (String[] args) + { + //Vars + int arr_size, i, j, swapNum; + + //Enter how big the array is + System.out.print("Enter an array size: "); + Scanner arr_scan = new Scanner(System.in); + arr_size = arr_scan.nextInt(); + + int array[] = new int[arr_size]; + + //Input the array numbers/elements + for (i = 0; i < arr_size; i++) + { + System.out.print("Enter the elements inside the array: "); + array[i] = arr_scan.nextInt(); + }//end for loop to input elements + + //Bubble sort + for (i = 0; i < arr_size-1; i++) + { + for (j = 0; j < arr_size-i-1; j++) + { + if (array[j] > array[j+1]) + { + swapNum = array[j]; + array[j] = array[j+1]; + array[j+1] = swapNum; + }//end if to swap + }//end nested for loop + }//end for loop to sort + + //End sort + System.out.print("Sorted array: "); + for (i = 0; i < arr_size; i++) + { + System.out.print(array[i] + " "); + }//end for loop to print out the sorted array + }//end main +}//end class \ No newline at end of file diff --git a/day31/README.md b/day31/README.md index 4c701504..1e4cb22c 100644 --- a/day31/README.md +++ b/day31/README.md @@ -66,6 +66,60 @@ public class bubbleSort { } ``` +### [Solution by thefluffyoshi](./Java/bubbleSort_thefluffyoshi.java) +```Java +/* + * @author thefluffyoshi + * date: 31/10/2020 + */ + +import java.util.Scanner; + +public class bubbleSort_thefluffyoshi +{ + public static void main (String[] args) + { + //Vars + int arr_size, i, j, swapNum; + + //Enter how big the array is + System.out.print("Enter an array size: "); + Scanner arr_scan = new Scanner(System.in); + arr_size = arr_scan.nextInt(); + + int array[] = new int[arr_size]; + + //Input the array numbers/elements + for (i = 0; i < arr_size; i++) + { + System.out.print("Enter the elements inside the array: "); + array[i] = arr_scan.nextInt(); + }//end for loop to input elements + + //Bubble sort + for (i = 0; i < arr_size-1; i++) + { + for (j = 0; j < arr_size-i-1; j++) + { + if (array[j] > array[j+1]) + { + swapNum = array[j]; + array[j] = array[j+1]; + array[j+1] = swapNum; + }//end if to swap + }//end nested for loop + }//end for loop to sort + + //End sort + System.out.print("Sorted array: "); + for (i = 0; i < arr_size; i++) + { + System.out.print(array[i] + " "); + }//end for loop to print out the sorted array + }//end main +}//end class +``` + ### [C++ Implementation](./C++/bubbleSort.cpp) ```cpp diff --git a/day31/day31.iml b/day31/day31.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day31/day31.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day32/day32.iml b/day32/day32.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day32/day32.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day33/day33.iml b/day33/day33.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day33/day33.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day38/day38.iml b/day38/day38.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day38/day38.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day4/day4.iml b/day4/day4.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day4/day4.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day5/day5.iml b/day5/day5.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day5/day5.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day6/day6.iml b/day6/day6.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day6/day6.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day7/day7.iml b/day7/day7.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day7/day7.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day8/day8.iml b/day8/day8.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day8/day8.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/day9/day9.iml b/day9/day9.iml new file mode 100644 index 00000000..f409c452 --- /dev/null +++ b/day9/day9.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index fa1db3fe..5f56ff71 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,9 +5,9 @@ "requires": true, "dependencies": { "@babel/runtime": { - "version": "7.11.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.11.2.tgz", - "integrity": "sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw==", + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.1.tgz", + "integrity": "sha512-J5AIf3vPj3UwXaAzb5j1xM4WAQDX3EMgemF8rjCP3SoW09LfRKAXQKt6CoVYl230P6iWdRcBbnLDDdnqWxZSCA==", "dev": true, "requires": { "regenerator-runtime": "^0.13.4"