From 8b7f5b1435a261b199a97a25b32993c6d0d600a1 Mon Sep 17 00:00:00 2001 From: Arthur Date: Sat, 26 Mar 2022 10:37:14 -0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20task=20completed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/javatest/.vscode/settings.json | 4 ++ learning-java-project/java/javatest/README.md | 18 +++++++++ .../java/javatest/bin/App.class | Bin 0 -> 562 bytes .../java/javatest/src/App.class | Bin 0 -> 461 bytes .../java/javatest/src/App.java | 5 +++ src/Main.class | Bin 0 -> 1004 bytes src/Main.java | 37 ++++++++++++------ 7 files changed, 53 insertions(+), 11 deletions(-) create mode 100644 learning-java-project/java/javatest/.vscode/settings.json create mode 100644 learning-java-project/java/javatest/README.md create mode 100644 learning-java-project/java/javatest/bin/App.class create mode 100644 learning-java-project/java/javatest/src/App.class create mode 100644 learning-java-project/java/javatest/src/App.java create mode 100644 src/Main.class diff --git a/learning-java-project/java/javatest/.vscode/settings.json b/learning-java-project/java/javatest/.vscode/settings.json new file mode 100644 index 00000000..96ee3d15 --- /dev/null +++ b/learning-java-project/java/javatest/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "java.project.sourcePaths": ["src"], + "java.project.outputPath": "bin" +} diff --git a/learning-java-project/java/javatest/README.md b/learning-java-project/java/javatest/README.md new file mode 100644 index 00000000..7c03a532 --- /dev/null +++ b/learning-java-project/java/javatest/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/learning-java-project/java/javatest/bin/App.class b/learning-java-project/java/javatest/bin/App.class new file mode 100644 index 0000000000000000000000000000000000000000..34799af28175730f27fdd0d646a4b98a334a250b GIT binary patch literal 562 zcmZut%T5A85UhcPg%t%s@cqC?g2u?v18QQ7#sg6k3?4iUIKd(NAj@L(v-F^e2S31% z5^M26NZ4e%r>AZ0c~lz%N7wi3uzy{5G5($``Aduassx+@T?QmR54 zM`~A~P`a%SC2N7N-Bu-(u}&YGsuO6>?V896C5 zoFM-rp}q1I`2(sb=~NO}5STnyw(ae%-FUuzSG2H%6%)&Ua-%O&SjC!v*$GK(n$MTU zdpD%t;;6YXqj9jB*Ylg|Ooy9Fa2b2yWGI4e5q=S#xL8J$Rhd~Z$9CS3cpktOV+e!) z1Y_!_fq9Zu5>rT%B*U{oWO_ieKcFT0f?Rg~6^lbEix8-tVEd3RNk{9v7uaBoVDlT( CxpVUX literal 0 HcmV?d00001 diff --git a/learning-java-project/java/javatest/src/App.class b/learning-java-project/java/javatest/src/App.class new file mode 100644 index 0000000000000000000000000000000000000000..5b429aad4dc4192e224b6427e61ffd6e7a45c510 GIT binary patch literal 461 zcmZuuT}uK%6g{J><8Eu3rhS_F5NJgH04sak!b^rRA(^I#~V z8*k{-ixqg1463cWMGg$k*~3VLvD9kDQTyp6sq>p5R$tGfkvNyeGDj5;Ov7lRLUS}L z1!g8m=NjE=6dA?L-YeJ>0fu!tP1;}^8`va?q3$M9zrN9v6#k}cyW6tdmTRrR7P)k}74O<|(U6ds0FuX|K35jLASXTJH)Ip3Kx-+zAj24DrxQi!2Lhh`#<1ViruKjwLl%l-Vz z>Vc?*42fk|y5TBAN6sl5Fc{1dKeZdDw&V?wHIO2t;(DGd?20cBxdD@*yW;zMfq!Dt zNz<1Gx)qCip$P0s-3>(&z39_nndryBmBOXdW+)m|&u>xr!OcjL>*sd@SB9l95WG=L zVF<%IMogq}i=qDp4ugKAB0Nb+a_uZpW0b;``$ea$<2FNI6xs@1FJG#0DMg@^jhPsS z%@A`{^dAW?rFCEK2Rv+M?OnfR*ZHxq zYjvOUOFOKS?*{=*+2*o&B7$s|#`%DuOL53Brqx460rZQb7!3_Y8!6x*#v zRRphi)gwe}MCU`fx7V9<%9OGc^4j4RKZ^J|R%mE9P#IDszZKNP1{G&Ws;Y}>LdfDF zJyrF^KzD=$t&eFpN|uq0&t8CiCWqk(t?C%)KoU<;AYV~`(B2?>Xz80)a?9%6wz>*h zS}VlQ&@*?AK{E4gv(PqajqF!scF!<+fovg>PMl-1pevJ0>*@G8=02j6;;g&GyhJ{= zk^6)wL9s~C2KvZPkOZApgM=l~g-$}dF+wkHoV;mRSi}Gc9>#M*H>kTEjNvsVQN)12^ literal 0 HcmV?d00001 diff --git a/src/Main.java b/src/Main.java index 4b88cab2..88ff3643 100644 --- a/src/Main.java +++ b/src/Main.java @@ -1,26 +1,41 @@ +import java.util.Scanner; public class Main { public static void main(String args[]) { - String question = ""; - String choiceOne = ""; - String choiceTwo = ""; - String choiceThree = ""; - - String correctAnswer = choiceTwo; - + String question = "Say my name!"; + String choiceOne = "Willie Wonka"; + String choiceTwo = "Woodrow Wilson"; + String choiceThree = "Walter White"; + + String correctAnswer = choiceThree; + // Write a print statement asking the question + System.out.println(question); // Write a print statement giving the answer choices - + System.out.println(choiceOne); + System.out.println(choiceTwo); + System.out.println(choiceThree); + + Scanner input = new Scanner(System.in); // Have the user input an answer // Retrieve the user's input - + String userAnswer = input.next(); + input.close(); + // If the user's input matches the correctAnswer... // then the user is correct and we want to print out a congrats message to the user. - + + if(userAnswer.equals(correctAnswer)) { + System.out.println("Congrats! You have choosen the correct answer!!!"); + }; + // If the user's input does not match the correctAnswer... // then the user is incorrect and we want to print out a message saying that the user is incorrect as well as what the correct choice was. - + + if(!userAnswer.equals(correctAnswer)) { + System.out.println("You failed!!!"); + } } }