Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Day 1, 2, 28 and 31 added (java) #378

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
17 changes: 17 additions & 0 deletions BONUS/Arrays/Arrays.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/AddAllElements" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/CheckIdentity" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/LinearSearch" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/MatrixSum" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Reverse" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/ReverseWords" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Transpose" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
18 changes: 18 additions & 0 deletions BONUS/Misc/Misc.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/CircleArea" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/LeapYear" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/MenuAdd" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/NaturalSum" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/OddEve" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Patterns" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Reverse" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/SumSquares" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
19 changes: 19 additions & 0 deletions BONUS/Recursion/Recursion.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/ArrayProduct" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/ArraySum" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Fibonacci" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/NaturalSum" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Power" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/Recursion" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/ReverseArray" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/ReverseString" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/SumSquares" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
11 changes: 11 additions & 0 deletions BONUS/Strings/Strings.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/CountWordFrequency" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
<td align="center"><a href="https://github.com/gaurav01k3"><img src="https://avatars0.githubusercontent.com/u/67451786?v=4?s=100" width="100px;" alt=""/><br /><sub><b>GAURAV KUMAR</b></sub></a><br /><a href="https://github.com/CodeToExpress/dailycodebase/commits?author=gaurav01k3" title="Documentation">📖</a> <a href="https://github.com/CodeToExpress/dailycodebase/commits?author=gaurav01k3" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/wboccard"><img src="https://avatars3.githubusercontent.com/u/72316984?v=4?s=100" width="100px;" alt=""/><br /><sub><b>wboccard</b></sub></a><br /><a href="https://github.com/CodeToExpress/dailycodebase/commits?author=wboccard" title="Documentation">📖</a> <a href="https://github.com/CodeToExpress/dailycodebase/commits?author=wboccard" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/d-l-mcbride"><img src="https://avatars3.githubusercontent.com/u/46550732?v=4?s=100" width="100px;" alt=""/><br /><sub><b>d-l-mcbride</b></sub></a><br /><a href="https://github.com/CodeToExpress/dailycodebase/commits?author=d-l-mcbride" title="Documentation">📖</a> <a href="https://github.com/CodeToExpress/dailycodebase/commits?author=d-l-mcbride" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/thefluffyoshi"><img src="https://avatars0.githubusercontent.com/u/54290315?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Katie</b></sub></a><br /><a href="https://github.com/CodeToExpress/dailycodebase/commits?author=thefluffyoshi" title="Code">💻</a></td>
</tr>
</table>

Expand Down
11 changes: 11 additions & 0 deletions Day1/Day1.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/Java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
40 changes: 40 additions & 0 deletions Day1/Java/FizzBuzz_thefluffyoshi.java
Original file line number Diff line number Diff line change
@@ -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
44 changes: 44 additions & 0 deletions Day1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 11 additions & 0 deletions Day2/Day2.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/Java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
37 changes: 37 additions & 0 deletions Day2/Java/Palindrome_thefluffyoshi.java
Original file line number Diff line number Diff line change
@@ -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
40 changes: 40 additions & 0 deletions Day2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions Day3/Day3.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/Java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
11 changes: 11 additions & 0 deletions day10/day10.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/Java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
11 changes: 11 additions & 0 deletions day11/day11.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/Java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
11 changes: 11 additions & 0 deletions day12/day12.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/Java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
11 changes: 11 additions & 0 deletions day13/day13.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/Java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
11 changes: 11 additions & 0 deletions day14/day14.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/Java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
11 changes: 11 additions & 0 deletions day15/day15.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/Java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
Loading