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

 

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

Write a method that returns 'true' if 'orig' begins with 'starts'. For example, if 'orig' is "Testing" and 'starts' is "Test", return true because 'orig' starts with 'starts'. For this problem you are restricted in the string methods you may use. The only string methods allowed are .length, .substring, and .equals. Look at the test data for examples.


test2022_11_17_APP1SLHL_startsWith("A man a plan a canal Panama", "A man a plan a canal Panama") → true
test2022_11_17_APP1SLHL_startsWith("A man a plan a canal Panama", "A man a plan a canal Panam") → true
test2022_11_17_APP1SLHL_startsWith("A man a plan a canal Panam", "A man a plan a canal Panama") → false

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

public boolean test2022_11_17_APP1SLHL_startsWith(String orig, String starts) { }

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

Copyright Nick Parlante 2017 - privacy