diff --git a/.vscode/settings.json b/.vscode/settings.json index e112a70..920db53 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,12 @@ { +<<<<<<< HEAD + "code-runner.runInTerminal": true +} +======= "java.project.sourcePaths": ["src"], "java.project.outputPath": "bin", "java.project.referencedLibraries": [ "lib/**/*.jar" ] } +>>>>>>> 2118b04ef028da4def9257e6799e4118d96f1eb2 diff --git a/ndtask/.vscode/settings.json b/ndtask/.vscode/settings.json new file mode 100644 index 0000000..e112a70 --- /dev/null +++ b/ndtask/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "java.project.sourcePaths": ["src"], + "java.project.outputPath": "bin", + "java.project.referencedLibraries": [ + "lib/**/*.jar" + ] +} diff --git a/ndtask/README.md b/ndtask/README.md new file mode 100644 index 0000000..7c03a53 --- /dev/null +++ b/ndtask/README.md @@ -0,0 +1,18 @@ +## Getting Started + +Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code. + +## Folder Structure + +The workspace contains two folders by default, where: + +- `src`: the folder to maintain sources +- `lib`: the folder to maintain dependencies + +Meanwhile, the compiled output files will be generated in the `bin` folder by default. + +> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there. + +## Dependency Management + +The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies). diff --git a/ndtask/bin/NDTASK.class b/ndtask/bin/NDTASK.class new file mode 100644 index 0000000..568f3ef Binary files /dev/null and b/ndtask/bin/NDTASK.class differ diff --git a/ndtask/src/NDTASK.class b/ndtask/src/NDTASK.class new file mode 100644 index 0000000..b8d51c8 Binary files /dev/null and b/ndtask/src/NDTASK.class differ diff --git a/ndtask/src/NDTASK.java b/ndtask/src/NDTASK.java new file mode 100644 index 0000000..9d85eb2 --- /dev/null +++ b/ndtask/src/NDTASK.java @@ -0,0 +1,32 @@ +import java.util.Scanner; + +public class NDTask { + public static void main(String[] args) { + Scanner scanner = new Scanner(System.in); + + System.out.println("Enter the first number:"); + int n1 = scanner.nextInt(); + scanner.nextLine(); // Consume newline character + + System.out.println("Enter the second number:"); + int n2 = scanner.nextInt(); + scanner.nextLine(); // Consume newline character + + int max; + + if (n1 > n2) { + max = n1; + } else if (n2 > n1) { + max = n2; + } else { + System.out.println("Both numbers are equal."); + scanner.close(); + return; + } + + System.out.println("The maximum of " + n1 + " and " + n2 + " is: " + max); + + scanner.close(); + } +} +