Going national

  • 10
  • Locked
Once diners get over their initial reservations about the proper color of breakfast foods, they fall in love with green eggs and ham. Sam-I-Am has big plans to open a national chain of restaurants featuring his signature dish. He'll launch the Green Eggs and Ham restaurant chain as soon as he can find suppliers of properly colored eggs. We will write a program that replaces the text "green eggs and ham" with "Green Eggs And Ham".
You can't complete this task, because you're not signed in.
Comments(12)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
TimbooLevel 8 , Shantou
yesterday, 11:31
Can any one help me? what's the problem of my code?
Lucas HoageLevel 14 , Savannah
4 June, 19:24
This one was a little tough. Still solvable. You can use StringBuffer to make the string mutable. In order to replace the value, you have to pass the char back as a String. String has a method to do this. Remember that index of 0 can be a space. So be sure to include 0 in your condition statement.
CamLevel 22 , Auckland
1 April, 05:12
A little hint. Pass the string into a character array. If a char c in the charArray == ' ', the next letter needs to be capitalized. It does not matter if that next char is also a ' ' , it will still pass the task ;)
Artur VerdyanLevel 22 , Hoboken
19 March, 18:30
I see the "input data" with which I need to work, I solve it with that data in mind, but it fails, just because there are also some input data which is not visible to me...Why?
Bill HineLevel 9 , Sarasota
4 December 2019, 19:22
. Another one of code gyms hidden requirements you only find out about after you hit verify make sure you account for the fact that the test input does not mean that each word will be single spaced they can be double spaced or more.
oli blaustromLevel 18 , Luzern
26 February, 18:19
How'd you solve this? I could only think of a for loop or changing to scanner; but there has to be a smarter method
VesaLevel 37 , Kaliningrad
22 November 2019, 10:25
Fine! The task forces us to study the methods of the String and Character classes.
SteveLevel 9 , Denver
6 August 2019, 18:08
I hope this isnt breaking the rules but this is key to pass the last task String[] words = s.trim().split("\\s+");
Michał KwaśnyLevel 22 , Krakow
27 June 2019, 15:19
Can someone point out what is wrong with this code? It works perfectly.
shabarish kumarLevel 20 , Hyderabad
22 June 2019, 05:50
its failing by saying that my output has extra spaces. But i have not found such that. Please help me
Ed MaphisLevel 20 , Painesville
25 May 2019, 19:59
Internet research helped solve this one.
RAGHU VAMSILevel 17 , HYDERABAD
16 June 2019, 16:08
yes!