Skip to content

Commit b818160

Browse files
committed
Filesystem Reformatting Changes (Reviewed)
1 parent f529760 commit b818160

File tree

528 files changed

+24989
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

528 files changed

+24989
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
[![forthebadge](https://forthebadge.com/images/badges/made-with-java.svg)](https://forthebadge.com)
2+
3+
## Introduction
4+
5+
Welcome to my code snippets and samples from the EasyFunCoding Advanced I class!
6+
These files were created from 2020 to 2021, and are continued to be maintained.
7+
Feel free to contact me via GitHub if you have any suggestions.
8+
9+
## Folder Structure
10+
11+
The workspace contains two folders by default, where:
12+
13+
- `src`: the folder to maintain sources
14+
- `lib`: the folder to maintain dependencies
15+
16+
## Dependency Management
17+
18+
The `JAVA DEPENDENCIES` view allows you to manage your dependencies. More details can be
19+
found [here](https://github.com/microsoft/vscode-java-pack/blob/master/release-notes/v0.9.0.md#work-with-jar-files-directly).
20+
21+
## Troubleshooting (Visual Studio Code)
22+
23+
If you encounter a `Failed to Load Main Class` or `Main Class Not Found` error,
24+
simply restart the Java Language Workspace by pressing `Cmd`+`Shift`+`P` and
25+
selecting `Restart and Delete Java Language Workspace.`
26+
Otherwise, try updating the Project Manager for Java in Visual Studio Code.
27+
28+
**Note: Once you rebuild the project, make sure you add in the `package` keyword,
29+
which has important information about the folder in which the `.java` code file resides.
30+
31+
## Troubleshooting (IntelliJ IDEA)
32+
33+
In the event of any issues, the tried and true method is going to the `File`
34+
dropdown menu, selecting `Invalidate Caches / Restart`
35+
and wait for the IDE to reboot and add the `.idea` settings folder to the project
36+
(a common issues across different platforms).
37+
38+
## Completed Homework Assignments:
39+
40+
- Class #1 to Class #16
41+
- Class #27 (Submitted)
42+
- Class #28 (Submitted)
43+
- Class #29 (Submitted)
44+
- Class #30 (Submitted)
45+
- Class #31 (Submitted)
46+
- Class #32 (Submitted)
47+
- Class #33 (Submitted)
48+
- Class #34 (Finished)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package JavaClass1;
2+
3+
import java.util.Date;
4+
5+
class Class1Part1 {
6+
public static void main(String[] args) {
7+
Date d = new Date();
8+
System.out.println(d);
9+
}
10+
}
11+
12+
// This is how you comment out Java code
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package JavaClass1;
2+
3+
//import java.util.Date;
4+
public class Class1Part2 {
5+
public static void main(String[] args) {
6+
int rows = 10;
7+
for(int i = 1; i <= rows; i++) {
8+
for(int j = 1; j <= i; j++) {
9+
System.out.print(i + "");
10+
}
11+
System.out.println();
12+
}
13+
}
14+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package JavaClass1;
2+
3+
public class Class1Part3 {
4+
public static void main(final String[] args)
5+
{
6+
System.out.println(3 + 2);
7+
System.out.println(3 - 2);
8+
System.out.println(3 * 2);
9+
System.out.println(3 / 2); // Only returns the int part...
10+
System.out.println( 3.0/2 );
11+
System.out.println( 3%2 );
12+
System.out.println( 3 == 2 );
13+
System.out.println( 3 != 2 );
14+
15+
}
16+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package JavaClass1;
2+
3+
import java.util.Scanner;
4+
5+
class Class1Part4 {
6+
public static void main(final String[] args) {
7+
8+
Scanner s = new Scanner(System.in);
9+
System.out.println("Please enter the height of the pyramid: ");
10+
int height = s.nextInt();
11+
s.close();
12+
13+
for (int i = 0; i < height; i++){
14+
for (int j = 0; j < height -i; j++)
15+
System.out.print(" ");
16+
for (int j = 0; j < i; j++)
17+
System.out.print("**");
18+
System.out.println();
19+
}
20+
}
21+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package JavaClass1;
2+
3+
public class Class1Part5 {
4+
public static void main(String[] args) {
5+
for (int i = 0; i <= 100; i = i + 2)
6+
System.out.println(i);
7+
}
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package JavaClass1;
2+
3+
class Class1Start {
4+
public static void main(String[] args) {
5+
for ( int i = 0; i<10; i++)
6+
System.out.println("Hello world! "+i);
7+
}
8+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package JavaClass1;
2+
3+
import java.util.Scanner;
4+
public class Homework1Part1
5+
{
6+
public static void main(String[] args)
7+
{
8+
int n;
9+
Scanner s = new Scanner(System.in);
10+
System.out.print("Enter the number you want to check:");
11+
n = s.nextInt();
12+
s.close();
13+
if(n % 2 == 0)
14+
{
15+
System.out.println("The entered number "+n+" is even ");
16+
}
17+
else
18+
{
19+
System.out.println("The entered number "+n+" is odd ");
20+
}
21+
}
22+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package JavaClass1;
2+
3+
import java.util.Scanner;
4+
public class Homework1Part2
5+
{
6+
public static void main(String[] args)
7+
{
8+
int num;
9+
Scanner s = new Scanner(System.in);
10+
System.out.print("Enter the number you want to check:");
11+
num = s.nextInt();
12+
s.close();
13+
boolean flag = false;
14+
for (int i = 2; i <= num / 2; ++i)
15+
{
16+
//Conditions for nonprime number
17+
if(num % i == 0)
18+
{
19+
flag = true;
20+
break;
21+
}
22+
}
23+
24+
if (!flag)
25+
System.out.println(num + " is a prime number.");
26+
else
27+
System.out.println(num + " is not a prime number.");
28+
29+
}
30+
31+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package JavaClass10;
2+
3+
import java.util.ArrayList;
4+
5+
public class Class10Part1 {
6+
public static void main(String[] args) {
7+
ArrayList<Integer> list = new ArrayList<Integer>();
8+
for (int i = 1; i <= 10; i++) {
9+
list.add(10 * i);
10+
}
11+
//list: [10, 20, 30, ..., 100]
12+
for (int i = 0; i < list.size(); i++) {
13+
list.remove(i);
14+
}
15+
/*
16+
1st pass: [20, 30, 40, ..., 100] removed 0
17+
2nd pass: [20, 40, 50, ..., 100] removed 1
18+
3rd pass: [20, 40, 60, 70, ..., 100] removed 2
19+
4th pass: [20, 40, 60, 80, 90, 100] removed 3
20+
5th pass: [20, 40, 60, 80, 100] removed 4
21+
Exits loop because we are at the end of the list
22+
*/
23+
System.out.println(list);
24+
25+
ArrayList<Integer> list1 = new ArrayList<Integer>();
26+
for (int i = 1; i <= 5; i++) {
27+
list1.add(2 * i);
28+
}
29+
//list: [2, 4, 6, 8, 10]
30+
int size = list.size();
31+
for (int i = 0; i < size; i++) {
32+
list1.add(i, 42);
33+
}
34+
// list: [42, 42, 42, 42, 42, 2, 4, 6, 8, 10]
35+
System.out.println(list1);
36+
37+
for (int k = 0; k < 20; k = k + 2) {
38+
if (k % 3 == 1) {
39+
System.out.print(k + " ");
40+
}
41+
}
42+
// Prints: 4 10 16
43+
}
44+
}

0 commit comments

Comments
 (0)