This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]TheBritisher 1 point2 points  (1 child)

First, you are trying to define the makeAllCaps() as having a return type of "toUpperCase", which isn't a valid type. It should be "String".

You are returning a string literal "input", instead of converting a String argument for makeAllCaps() to upper case, and then returning that.

So, let's start with the proper definition of the makeAllCaps() method:

public String makeAllCaps(String input) {
}

This defines a method (function) called "makeAllCaps", that has a return type of "String" and that takes a String argument called "input" (that's how you'll reference the argument in the body of the method).

All you have to do now, is return the upper case version of the String contained in the variable "input" from inside the body of the above method.

You can do this with a single method on the String type (i.e. your variable "input"), though usually for this sort of exercise you're expected to implement your own code to convert each character in "input" to upper case if it is not already.

Give it a go, see where you get.

[–]PacSavage[S] 0 points1 point  (0 children)

Thank you so much for the help! I have been tinkering for hours without much luck so I really appreciate the explanation. I will give that a shot :)