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

 

jebbert@volusia.k12.fl.us > nov21_2019_APP1SLHL_swe4
prev  |  next  |  chance

Write a method that returns "Han shot first!" if input parameter 'str' starts with "Maclunkey". Otherwise return the 'str' unaltered. The only string methods allowed are: .equals, .length, .substring, .charAt, and .compareTo. Look at the test data for examples.


nov21_2019_APP1SLHL_swe4("Maclunkey was here") → "Han shot first!"
nov21_2019_APP1SLHL_swe4("Maclunkey") → "Han shot first!"
nov21_2019_APP1SLHL_swe4("Maclunk") → "Maclunk"

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

public String nov21_2019_APP1SLHL_swe4(String str) { }

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: 290

Copyright Nick Parlante 2017 - privacy