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

 

abraskin@mbusd.org 2016_student_creations_01 > protectPassword
prev  |  next  |  chance

You are given a password represented by the String password. In order to keep the password hidden from potential onlookers, the computer will censor it with asterisks when it's typed. However it will make the first and last character visible so it is easier for you to check. You must find a way to return the censored password. The password must be at least 6 characters, if not, return "INVALID".


protectPassword("Password") → "P******d"
protectPassword("1234") → "INVALID"
protectPassword("ABC123") → "A****3"

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

String protectPassword(String password) { }

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