Skip to content

Commit 5d2c3fa

Browse files
committed
Migrate development environment from Windows to macOS and continue project updates
- Shifted primary development environment from Windows to macOS to ensure better performance, stability, and streamlined workflow for Java development. - Removed OS-specific metadata and ensured platform-agnostic project compatibility. - Normalized line endings to LF for cross-platform consistency. - Verified and adjusted file paths, permissions, and encoding settings to suit macOS environment. - Cleaned up unnecessary Windows-generated files and updated Git configuration accordingly. - Future commits and development will now be managed entirely from macOS. This migration ensures a cleaner, more consistent setup moving forward and prepares the project for scalable development across Unix-based systems. Future development will continue on macOS for a smoother, Unix-based experience. Signed-off-by: Someshdiwan <[email protected]>
1 parent ee5cda8 commit 5d2c3fa

30 files changed

+702
-1
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<content url="file://$MODULE_DIR$">
6+
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
7+
</content>
8+
<orderEntry type="jdk" jdkName="23" jdkType="JavaSDK" />
9+
<orderEntry type="sourceFolder" forTests="false" />
10+
</component>
11+
</module>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
public class BreakingTheIce
2+
{
3+
public static void main(String[] args)
4+
{
5+
int temperature = 100;
6+
int ice = 0;
7+
boolean machineOn = true;
8+
System.out.println("Let's cool this water!");
9+
while (machineOn)
10+
{
11+
temperature -= 5;
12+
if (temperature > 40)
13+
{
14+
System.out.println("Too hot! Thermometer unusable.");
15+
continue;
16+
}
17+
System.out.println("Temperature -> " + temperature);
18+
if (temperature <= ice)
19+
{
20+
System.out.println("We have ice!");
21+
break;
22+
}
23+
}
24+
}
25+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
public class FindingPrimes
2+
{
3+
public static void main(String[] args)
4+
{
5+
int currentNumber = 2; //Number analyzed
6+
int maxNumber = 20; //Maximum value to be checked
7+
8+
//Main loop that goes from 2 to 20
9+
while(currentNumber <= maxNumber)
10+
{
11+
//Loop that checks all integers from 2 to the current number (starts with 2, ends with 20)
12+
for (int divisor = 2; divisor <= currentNumber; divisor++) {
13+
//We know that the number is prime if it already checked all previous divisors
14+
if (divisor == currentNumber) {
15+
System.out.println(currentNumber + " is a prime number!");
16+
/* break or continue */;
17+
}
18+
//We know that the number is NOT prime if it can be divided by a lower integer
19+
if (currentNumber % divisor == 0) {
20+
System.out.println(currentNumber + " is NOT a prime number!");
21+
/* break or continue */;
22+
}
23+
}
24+
//After finished checking if the number is prime or not, we must proceed to the next one
25+
currentNumber++;
26+
}
27+
}
28+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
public class Loops
2+
{
3+
public static void main(String[] args)
4+
{
5+
System.out.println("These are the odd numbers from 1 to 100.");
6+
System.out.println("Ready?");
7+
//for values from 1 to 100
8+
for (int value = 1; value <= 100; value++)
9+
{
10+
System.out.println(value); //print them
11+
}
12+
System.out.println("That was fast!");
13+
}
14+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
public class NestingLoopsAndConditionals
2+
{
3+
public static void main(String[] args)
4+
{
5+
System.out.println("Behold my rectangle!");
6+
int rows = 6, columns = 34;
7+
for (int x = 1; x <= rows; x++)
8+
{
9+
for (int y = 1; y <= columns; y++)
10+
{
11+
if (x == 1 || x == rows)
12+
System.out.print("-");
13+
else if (y==1 || y==columns)
14+
System.out.print("|");
15+
else
16+
System.out.print(" ");
17+
}
18+
System.out.println();
19+
}
20+
}
21+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
public class Practice
2+
{
3+
public static void main(String[] args)
4+
{
5+
int points = /* Replace with an appropriate value */;
6+
boolean isVIPClient = /* Replace with an appropriate value */;
7+
8+
if (points >= 10 || isVIPClient)
9+
System.out.println("Dear customer, your purchase has accredited you with points.");
10+
if (points > 10)
11+
System.out.println("You may spend your points on a set of " + points * 5 + " paper clips.");
12+
if (points >= 99 && isVIPClient)
13+
System.out.println("You may spend your points on a notebook.");
14+
if (points > 149 || isVIPClient)
15+
System.out.println("You may spend your points on a cutlery set.");
16+
}
17+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
public class Practice2
2+
{
3+
public static void main(String[] args)
4+
{
5+
double height = 1.5; //in meters
6+
System.out.println("To enter the roller coaster, you must be at least 1.5 meters tall.");
7+
if (/* Replace with the appropriate condition */)
8+
System.out.println("You may proceed.");
9+
else
10+
System.out.println("You may not ride it.");
11+
}
12+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
public class Practice3
2+
{
3+
public static void main(String[] args)
4+
{
5+
double temperature; //in Celsius degrees
6+
double humidity; //as a percentage
7+
boolean smartMode;
8+
9+
/*
10+
The previous variables have been assigned hidden values here.
11+
*/
12+
13+
if (smartMode) //if smartMode is true, then...
14+
{
15+
if (humidity > 0.7) //if humidity is greater than 0.7 then...
16+
System.out.println("Dehumidifier activated.");
17+
else //else, if the humidity is lower, then...
18+
System.out.println("Smart save mode on. Only fan activated.");
19+
}
20+
else //else, if smartMode is false, then...
21+
{
22+
if (humidity > 0.7) //if humidity is greater than 0.7 then...
23+
System.out.println("Dehumidifier activated.");
24+
else if (temperature > 24) //else, if the humidity is lower, then...
25+
System.out.println("Fan activated.");
26+
}
27+
}
28+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
public class Practice4 {
2+
public static void main(String[] args)
3+
{
4+
int hour24Format = 13; //13 hours is equivalent to 1 P.M.
5+
boolean isItRaining = false;
6+
System.out.println("I'm hungry, let's eat something.");
7+
if (7 < hour24Format && hour24Format < 11 )
8+
{
9+
System.out.print("Let's have breakfast at ");
10+
if (isItRaining)
11+
System.out.println("the kitchen.");
12+
else
13+
System.out.println("the back yard.");
14+
}
15+
else if (11 <= hour24Format && hour24Format < 15)
16+
{
17+
System.out.print("Let's have lunch at ");
18+
if (isItRaining)
19+
System.out.println("the dining room.");
20+
else
21+
System.out.println("a restaurant.");
22+
}
23+
else if (hour24Format < 21)
24+
{
25+
System.out.print("Let's have dinner at ");
26+
if (isItRaining)
27+
System.out.println("the dining room.");
28+
else
29+
System.out.println("the mall.");
30+
}
31+
else
32+
System.out.println("Thinking it through... this is no time to eat.");
33+
}
34+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
public class TheForLoop
2+
{
3+
public static void main(String[] args)
4+
{
5+
System.out.println("I'm going to print Java 10 times.");
6+
System.out.println("Ready?");
7+
for (int counter = 1; counter <= 10; counter++)
8+
{
9+
System.out.println(counter + " Java");
10+
}
11+
System.out.println("That was fast!");
12+
}
13+
}

0 commit comments

Comments
 (0)