This topic contains a solution. Click here to go to the answer

Author Question: Given that s is a String, what does the following loop do? (Read 82 times)

BrownTown3

  • Hero Member
  • *****
  • Posts: 564

Question 1

The following code has a syntax error immediately before the word else.  What is the error and why does it arise?  Fix the code so that this statement is a legal if-else statement.


Question 2

Given that s is a String, what does the following loop do?

◦ it prints s out backwards
◦ it prints s out forwards
◦ it prints s out backwards after skipping the last character
◦ it prints s out backwards but does not print the 0th character
◦ it yields a run-time error because there is no character at s.charAt(j-1) for j = 0


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by BrownTown3 on Aug 30, 2020

Eazy416

  • Sr. Member
  • ****
  • Posts: 360
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 64% of students answer this correctly




BrownTown3

  • Member
  • Posts: 564
Reply 2 on: Aug 30, 2020
Thanks for the timely response, appreciate it


phuda

  • Member
  • Posts: 348
Reply 3 on: Yesterday
Wow, this really help

 

Did you know?

Most fungi that pathogenically affect humans live in soil. If a person is not healthy, has an open wound, or is immunocompromised, a fungal infection can be very aggressive.

Did you know?

The oldest recorded age was 122. Madame Jeanne Calment was born in France in 1875 and died in 1997. She was a vegetarian and loved olive oil, port wine, and chocolate.

Did you know?

Russia has the highest death rate from cardiovascular disease followed by the Ukraine, Romania, Hungary, and Poland.

Did you know?

Alzheimer's disease affects only about 10% of people older than 65 years of age. Most forms of decreased mental function and dementia are caused by disuse (letting the mind get lazy).

Did you know?

Though methadone is often used to treat dependency on other opioids, the drug itself can be abused. Crushing or snorting methadone can achieve the opiate "rush" desired by addicts. Improper use such as these can lead to a dangerous dependency on methadone. This drug now accounts for nearly one-third of opioid-related deaths.

For a complete list of videos, visit our video library