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

 

crehwinkel@frhsd.com apcsa-unit4-loops > firstThree
prev  |  next  |  chance

Given a string, return a string length 3 made of its first 3 chars. If the string length is less than 3, use '@' for the missing chars.


firstThree("hello") → "hel"
firstThree("hi") → "hi@"
firstThree("h") → "h@@"

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

public String firstThree(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: 100

Copyright Nick Parlante 2017 - privacy