Problem: 'Is It You, Cody?' in Java | AskTheCode

Asked By: Crystal | Problem solving in Java | Problems related to Strings in Java | Ask The Code


Is It You, Cody? Can you identify if Cody's name is spelled right? If so, then make a program that accepts four one-letter strings separated by space and print "Correct" if the inputted strings, combined in order, spell the name Cody correctly. If not, print "Wrong". It doesn't matter if it's in uppercase or lowercase, as long as it's spelled correctly, it's considered correct.

Now, will you take on this task?

Input Sample:

c O D y

Output Sample:



import java.util.Scanner;

public class solution_IIY_Cody{

public static void main(String[] args) {

Scanner sc = new Scanner(;

String a =;

String b =;

String c =;

String d =;

a = a+b+c+d;

String s = "cody";

if (a.toLowerCase().equals(s)) {








5 views0 comments

Recent Posts

See All

"Believe you can and you're halfway there"