fork download
  1. public String aOrAn(String word) {
  2. //code here
  3. Set vowelset = new Set('a','e','i','o','u');
  4. String temp = word;
  5. String result;
  6. If(temp.startsWith(vowelset)){
  7. result = 'an' +temp ;
  8. }else{
  9. result = 'a' +temp ;
  10. }
  11. return result;
  12. }
Success #stdin #stdout #stderr 0.02s 10004KB
stdin
Standard input is empty
stdout
Object: nil error: did not understand #String
MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
UndefinedObject(Object)>>doesNotUnderstand: #String (SysExcept.st:1448)
UndefinedObject>>executeStatements (prog:1)
Object: String error: did not understand #word
MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
String class(Object)>>doesNotUnderstand: #word (SysExcept.st:1448)
UndefinedObject>>executeStatements (prog:1)
stderr
./prog:2: parse error, expected '}'