Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How do I fix this spacing error in my coding? 5 points Status: Not Submitted Write a program called Teen that takes a sentence and

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
How do I fix this spacing error in my coding?
5 points Status: Not Submitted Write a program called Teen that takes a sentence and returns a new sentence based on how a teenager might say that. The method that creates the new string should be called teenTalk and should have the signature shown in the starter code. The way to do that is to put the word "like" in between each of the words in the original sentence. For example, teenTalk("That is so funny!") would return "That like is like so like funny!". Sample output: Sonequa Martin-Green is in grade 10 and wants to send this text: Enter the text message being sent: Hello world how are you doing? The teen talk text would be: Hello like world like how like are like you like doing? Status: Not Submitted iii FILES NMON Teen java 8 TeenTester java 4.3.10: Teen Talk Save Subenit. Continue 1 public class Teen 2. private String first Name; private String lastName; 5 private int grade; private Boolean text Messages; 7 V/ Constructor to make a teen with a first and last name, grade in 9 // and whether they text message others and need to write texts to 10 11 W This defines the state of the teen. 12 public Teen(String theFirstName, String theLastName, int thegrade, 13 14 firstName - theFirstName; 15 lastName theLast Name; 16 grade theGrade; 17 text Messages - theText Messages; 18 19 20 // tostring method to print out the state of teen object 21 public String toString() 22- 23 return firstNamen lastName + " is in grade 1 + grade + 24 > 25 26 Create this method so that it changes the text message 27 W and places the word "like" in place of each space 28 // in the message. 29 Status: NOT Submitted 4.3.10: leen Tak Save Submit Continue !!! FILES 21 22 - 23 24 25 26 27 Teen java D TeenTester.java 28 29 30 - 31 32 33 34 - 35 36 37- 38 39 public String toString() { return firstName + " " + lastName + " is in grade " + grade + } // Create this method so that it changes the text message // and places the word "like" in place of each space // in the message. public String teenTalk(String text) { String baby Talk[]- text.split(" "); String babyTalkString for(int 1-0;i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 9 For Linux UNIX And Windows Advanced Database Administration Certification Certification Study Guide

Authors: Roger E. Sanders, Dwaine R Snow

1st Edition

1583470808, 978-1583470800

More Books

Students also viewed these Databases questions

Question

What are the stages of project management? Write it in items.

Answered: 1 week ago