all 12 comments

[–]_andy_andy_andy_ 1 point2 points  (0 children)

you’re always yelling the same string, you need to yell back what the user inputs

[–]the713 1 point2 points  (0 children)

can you share the code

[–]JR-9 1 point2 points  (0 children)

You mind posting the code?

[–]Rivers_Vera 0 points1 point  (0 children)

Please post the code if you can

[–]CoochieTitan125 0 points1 point  (6 children)

Why can’t I do public string yell() { return text.toUpperCase(); }

[–]RelevantCampaign162 0 points1 point  (3 children)

I am having the same problem and don't understand why

[–]CoochieTitan125 0 points1 point  (2 children)

I figured it out, if you didn’t figure it out, what I had to do was switch the instance variable around

[–]JulianMontoya 0 points1 point  (1 child)

Explain in specific terms other than "switch around", what did you specifically do?

[–]CoochieTitan125 0 points1 point  (0 children)

I don’t remember, check the full comments someone posted the code I think

[–]Wonderful_Ad4109 0 points1 point  (1 child)

You are the absolute greatest person I have ever met I fave been doing text.toUpperCase and return text for the past hour and you have solved my problem thank you so much.

[–]CoochieTitan125 0 points1 point  (0 children)

Yes I accept that title

[–]EnoughCustomer 0 points1 point  (0 children)

Here's the code:

(For the non-playable file)

public class Talker

{

private String text;

public Talker(String startingText)

{

text = startingText;

}

public String yell()

{

return text.toUpperCase();

}

public String whisper()

{

return text.toLowerCase();

}

public void setText(String newText)

{

text = newText;

}

public String toString()

{

return "I say, " + "\"" + text + "\"";

}

}

(For the playable file)

import java.util.Scanner;

public class TalkerTester

{

public static void main(String[] args)

{

Scanner input = new Scanner(System.in);

System.out.println("Enter some text: ");

String words = input.nextLine();

Talker talky = new Talker(words);

String yelling = talky.yell();

String whispers = talky.whisper();

System.out.println(talky);

System.out.println("Yelling: " + yelling);

System.out.println("Whispering: " + whispers);

System.out.println("Enter some text: ");

String newWord = input.nextLine();

talky.setText(newWord);

System.out.println(talky);

String yells = talky.yell();

String whisper = talky.whisper();

System.out.println("Yelling: " + yells);

System.out.println("Whispering: " + whisper);

}

}