id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

sspiege3@schools.nyc.gov magpieactivity4hwa > notGuilty
prev  |  next  |  chance

Write a method that takes a sentence and modifies the sentence so that if it says "guilty" it will now say "not guilty." You will need to check that "not guilty" is not already in the sentence. Preconditions: You may assume that all letters lowercase. This problem is not producing correct results if you try to concatenate the strings (i.e. use addition and substrings). If you use the replace method (demo-ed earlier this week) your code will probably work!


notGuilty("Are you guilty?") → "Are you not guilty?"
notGuilty("You are kind") → "You are kind"
notGuilty("I am not guilty") → "I am not guilty"

...Save, Compile, Run (ctrl-enter)

public String notGuilty( String sent) }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 100

Copyright Nick Parlante 2017 - privacy