diff --git a/home_work/.vscode/launch.json b/home_work/.vscode/launch.json new file mode 100644 index 0000000..9bcf63e --- /dev/null +++ b/home_work/.vscode/launch.json @@ -0,0 +1,20 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "java", + "name": "greetings", + "request": "launch", + "mainClass": "greetings" + }, + { + "type": "java", + "name": "Current File", + "request": "launch", + "mainClass": "${file}" + } + ] +} \ No newline at end of file diff --git a/home_work/Date.java b/home_work/Date.java new file mode 100644 index 0000000..879d729 --- /dev/null +++ b/home_work/Date.java @@ -0,0 +1,17 @@ +public class Date { + public static void main(String args[]) { + String day, month; + int date, year; + day = "Wednesday"; + date = 8; + month = "January"; + year = 2025; +// System.out.println(day); +// System.out.println(month); +// System.out.println(date); +// System.out.println(year); + System.out.printf("American format: %s, %s %d, %d.\n", day, month, date, year); + System.out.println("European format: " + day + " " + date + " " + month + " " + year + "."); +} + +} diff --git a/home_work/Example.java b/home_work/Example.java new file mode 100644 index 0000000..8667b59 --- /dev/null +++ b/home_work/Example.java @@ -0,0 +1,7 @@ +public class Example { + public static void main(String[] args){ + + +} + +} diff --git a/home_work/Hello2.java b/home_work/Hello2.java new file mode 100644 index 0000000..eb12ac6 --- /dev/null +++ b/home_work/Hello2.java @@ -0,0 +1,9 @@ +public class Hello2 { + public static void main(String[] args){ + System.out.print("Hello, World! "); // first line + System.out.print("How are you? "); // another line + System.out.println("Another line."); + System.out.println("The fourth line."); + System.out.println(new String("Heitor").compareTo(new String("Zanza"))); + } +} diff --git a/home_work/Hello3.java b/home_work/Hello3.java new file mode 100644 index 0000000..e339a37 --- /dev/null +++ b/home_work/Hello3.java @@ -0,0 +1,9 @@ +public class Hello3 { + public static void main(String[] args) { + System.out.print("Hello!\nHow are you doing?\n \n"); + System.out.print("She just said \"Hello\" to me.\n"); + System.out.println('A'); + +} + +} \ No newline at end of file diff --git a/home_work/Sketch.java b/home_work/Sketch.java new file mode 100644 index 0000000..b88f1d3 --- /dev/null +++ b/home_work/Sketch.java @@ -0,0 +1,6 @@ +public class Sketch { + + public static void main(String[] args){ + + } +} diff --git a/home_work/Time.java b/home_work/Time.java new file mode 100644 index 0000000..849f4fb --- /dev/null +++ b/home_work/Time.java @@ -0,0 +1,20 @@ +public class Time { + public static void main(String[] args) { + int hour, minute, + second, day, + time, remaining; + double percentageDay; + + hour = 20; + minute = 23; + second = 30; + day = 24 * 3600; // secs + time = (hour * 3600) + (minute * 60) + second; + remaining = day - time; + percentageDay = time * 100.0 / (day); + + System.out.println("Time passed since midnight: " + time + " seconds."); + System.out.println("Time of the day remaing: " + remaining + "seconds."); + System.out.printf("Percentage of the day that has passed: %.2f\n", percentageDay); + } +} diff --git a/home_work/greetings.java b/home_work/greetings.java new file mode 100644 index 0000000..f34e43a --- /dev/null +++ b/home_work/greetings.java @@ -0,0 +1,7 @@ +public class greetings { +public static void main(String[] args) { + System.out.println("Hello"); + System.out.println("Nice World!"); +} + +} diff --git a/home_work/hello.java b/home_work/hello.java new file mode 100644 index 0000000..f7bdf31 --- /dev/null +++ b/home_work/hello.java @@ -0,0 +1,11 @@ +public class hello { + public static void main(String[] args) { + int age = 35; + if(args.length >= 2){ + System.out.println("Hello, " + args[0] + args[1]); + } else { + System.out.println("Please, provide at least two arguments."); + } + System.out.println(age); + } +} diff --git a/home_work/tempCodeRunnerFile.java b/home_work/tempCodeRunnerFile.java new file mode 100644 index 0000000..cb49491 --- /dev/null +++ b/home_work/tempCodeRunnerFile.java @@ -0,0 +1 @@ +'She said hello.' \ No newline at end of file