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

 

andersoniii.edwin@cusd80.com > convertToMilitaryAMPM
prev  |  next  |  chance

Write the method convertToMilitaryAMPM that receives a string as input and returns a string to military time. The last two characters will designate Am or PM. Reminder: 12:00 AM will be assigned 0 hours.


convertToMilitaryAMPM("1:23AM") → "0123 hours"
convertToMilitaryAMPM("4:45AM") → "0445 hours"
convertToMilitaryAMPM("10:04AM") → "1004 hours"

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

public String convertToMilitaryAMPM(String thetime) }

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