Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Chapter 7; Debugging Exercises; p. 388; (DebugSeven3 to FixDebugSeven3); Java Pr

ID: 3764511 • Letter: C

Question

Chapter 7; Debugging Exercises; p. 388; (DebugSeven3 to FixDebugSeven3); Java Programming; 8th Edith; Joyce Farrell; THANK YOU!!!

c. DebugSeven3.java

// Program displays some facts about a string
public class DebugSeven3
{
public static void main(String[] args)
{
String quote =
"Honesty is the first chapter in the book of wisdom. - Thomas Jefferson";

System.out.println("index.of('f') is: " + indexOf('f'));
System.out.println("index.of('x') is: " + indexOf('x'));
System.out.println("char.At(5) is: " + charAt(5));
System.out.println("endsWith("daughter") is: " + quote.endswith("daughter"));
System.out.println("endsWith("son") is: " + quote.endswith("son"));
System.out.println("replace('e', '*') is: " + quote.replace('e', 'M'));
}
}

Explanation / Answer

index.of('f') is: 15

index.of('x') is: -1

char.At(5) is: t

endsWith("daughter") is: false

endsWith("son") is: true

replace('e', '*') is: HonMsty is thM first chaptMr in thM book of wisdom. - Thomas JMffMrson

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote