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

 

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

When you type your password, the characters are displayed as "*" instead of the actual characters you type. Write a method that converts any string into a string of the same length, but with each character replaced with "*". Spaces are NOT allowed in the string. If ANY spaces appear anywhere in the string, instead of returning a string of "*" characters, return a string "ERROR".


test2021_02_25_APP1SLHL_passwordHide("Passwords cannot have spaces") → "ERROR"
test2021_02_25_APP1SLHL_passwordHide("WhatGoodIsAPasswordWithout#1234") → "*******************************"
test2021_02_25_APP1SLHL_passwordHide("drowssaP") → "********"

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

public String test2021_02_25_APP1SLHL_passwordHide(String pswrd) { }

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

Copyright Nick Parlante 2017 - privacy