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

 

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

Write a method that returns the input parameter 'str' but with dashes at the front and back. For example, if 'str' is "Hello" you would return "-Hello-". Look at the test data for examples.


practiceQuiz2023_09_05_APP1SLHL_dashes("this is a practice quiz") → "-this is a practice quiz-"
practiceQuiz2023_09_05_APP1SLHL_dashes("Watts the units for power?") → "-Watts the units for power?-"
practiceQuiz2023_09_05_APP1SLHL_dashes("") → "--"

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

public String practiceQuiz2023_09_05_APP1SLHL_dashes(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: 200

Copyright Nick Parlante 2017 - privacy