From 1686e12fa49190a8e50522de009beb07f6cd5ce6 Mon Sep 17 00:00:00 2001 From: Lycan66 Date: Thu, 14 Mar 2024 11:36:16 -0500 Subject: [PATCH] Add plaster solution in Java --- Codewars/YESORNO.java | 24 ++++++++++++++++++++++++ README.md | 1 + 2 files changed, 25 insertions(+) create mode 100644 Codewars/YESORNO.java diff --git a/Codewars/YESORNO.java b/Codewars/YESORNO.java new file mode 100644 index 00000000..a7e2f2cc --- /dev/null +++ b/Codewars/YESORNO.java @@ -0,0 +1,24 @@ +package Codewars; +/* + * URL: https://www.codewars.com/kata/53369039d7ab3ac506000467/train/java + */ + +import java.util.InputMismatchException; +import java.util.Scanner; + +public class YESORNO { + public static void main(String[] args) throws InputMismatchException{ + + try (Scanner sc = new Scanner(System.in)) { + boolean arg = sc.nextBoolean(); + System.out.println(boolToWord(arg)); + }catch(InputMismatchException ex){ + } + } + + public static String boolToWord(boolean b) { + if (b) return "Yes"; + return "No"; + } + +} diff --git a/README.md b/README.md index 791a2e2c..ba653246 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,7 @@ In this repository, you can find the solutions (as source code) for the problems | [Nauman Chaudhary](https://github.com/nauman-chaudhary)
| Pakistan | Python | | | [Gourav Rusiya](https://github.com/GouravRusiya30)
| India | Java | https://www.hackerrank.com/gouravrusiya786 | | [Trushita Maurya](https://github.com/trushita23)
| India | Java +| [Santiago Cardona](https://github.com/lycan66)
| Colombia | Java ### License [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://github.com/ows-ali/Hacktoberfest/blob/master/LICENSE)