For further help with Coding Bat (Java), please check out my books. I am also available for tutoring.
In the String-1 section on CodingBat you have the chance to familiarize yourself with basic string operations. The exercises do get a bit repetitive, but you should be able to quickly go through all of them and move on to more challenging parts.
All solutions were successfully tested on 19 January 2013.
helloName:
public String helloName(String name) { return "Hello " + name + "!"; }
makeAbba:
public String makeAbba(String a, String b) { return a + b + b + a; }
makeTags:
public String makeTags(String tag, String word) { return "<" + tag + ">" + word + "</" + tag + ">"; }
makeOutWord:
public String makeOutWord(String out, String word) { return out.substring(0,2) + word + out.substring(2); }
extraEnd:
public String extraEnd(String str) { int len = str.length(); return str.substring(len - 2) + str.substring(len - 2) + str.substring(len - 2); }
firstTwo:
public String firstTwo(String str) { if (str.length() < 2) return str; return str.substring(0, 2); }
firstHalf:
public String firstHalf(String str) { return str.substring(0, str.length()/2); }
withoutEnd:
public String withoutEnd(String str) { return str.substring(1, str.length() - 1); }
comboString:
public String comboString(String a, String b) { if (a.length() > b.length()) return b + a + b; return a + b + a; }
nonStart:
public String nonStart(String a, String b) { return a.substring(1) + b.substring(1); }
For further help with Coding Bat (Java), please check out my books. I am also available for tutoring.
Pingback: Work | namfam
Who’s here from Charb’s class?
i feel you
i dont understand anything
me neither guys, I don’t code well on this site
Which of yalls in Mattern’s @ LHS?
I am
no cap this is mega gay, just like mrs. r
m uch knowledge
r espectable code
s uper good learning skills
R eally good pieces of code
i understand everything now
s uperbly done
g reat
a mazing
y do i understand everything?