From e9f51722b060c1e061139e5a9fbd8b811295bd7c Mon Sep 17 00:00:00 2001 From: Prashasti Date: Sat, 16 Jan 2021 22:38:57 +0530 Subject: [PATCH] FLAMES CALCULATOR --- .classpath | 5 +- build/classes/.gitignore | 2 +- .../testing/TestFlamesCheckService.class | Bin 0 -> 1513 bytes src/service/FlamesCheckService.java | 118 ++++++++++++++++-- src/testing/TestFlamesCheckService.java | 54 ++++---- 5 files changed, 141 insertions(+), 38 deletions(-) create mode 100644 build/classes/testing/TestFlamesCheckService.class diff --git a/.classpath b/.classpath index 2846539..4c0579d 100644 --- a/.classpath +++ b/.classpath @@ -8,10 +8,11 @@ - + - + + diff --git a/build/classes/.gitignore b/build/classes/.gitignore index 4e7e508..c6ca2cf 100644 --- a/build/classes/.gitignore +++ b/build/classes/.gitignore @@ -1 +1 @@ -/controller/ +/service/ diff --git a/build/classes/testing/TestFlamesCheckService.class b/build/classes/testing/TestFlamesCheckService.class new file mode 100644 index 0000000000000000000000000000000000000000..a1dc75871d223beb087153376e790e98cc2090cb GIT binary patch literal 1513 zcmeH{!Ee(r6vjViUDJkcEnUYL8^hejWxa5s6B3%}DH{?km3DMfZ*@uR%62R5FGB)p z-1(y>Uecl+TA>{frycU19e?jjWdHnr-F?3W@D{H^1Pn)BI0Vj1vRoWELIfAA`ma^~}sBva50+4%WA|lbojzFNv7d zV_>MAE9Z!^K6M0#*Pu>DEtAo+i8952#vv*ct3@l_DAuAMh%TG8Z`l4>Xr59m7b|5n qXVu!9!O2y1c(@NB8tqrB?&e2rUujaz^hR3G2~N0dwCe)t;?UC(m> literal 0 HcmV?d00001 diff --git a/src/service/FlamesCheckService.java b/src/service/FlamesCheckService.java index a8c006a..cb2d9ca 100644 --- a/src/service/FlamesCheckService.java +++ b/src/service/FlamesCheckService.java @@ -1,9 +1,111 @@ package service; - -// Create a class called FlamesCheckService -// FlamesCheckService has a method findFlames to find the flames between two names -// char findFlames(String name1, String name2) takes two strings as arguments -// Your task is to calculate the flames value and return the corresponding character as output -// You must return only the following values ['f','l','a','m','e','s'] -// change the return value at the end of the method corresponding to your return value - +import java.util.*; +class flames +{ + public static char findFlames(String name1, String name2) + { + name1 = name1.toLowerCase(); + name2 = name2.toLowerCase(); +String n1[] = name1.split(" "); +String n2[] = name2.split(" "); +name1=""; +name2=""; +int len1=n1.length; +int len2=n2.length; +for(int i=0;i