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

 

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

Write a method that accepts three parameters: 'hours' indicates the hours and will be in the range 1<=hours<=12; 'minutes' indicates the minutes and will be in the range 0<=minutes<=59; 'AM' is true if it is AM and false if it is PM. Return a string to represent the current time in the format shown in the test data. As preconditions you may assume that all the input parameters meet the criteria established above.


quiz2021_12_08_APSLHL_time(5, 55, true) → "5:55 AM"
quiz2021_12_08_APSLHL_time(11, 1, true) → "11:01 AM"
quiz2021_12_08_APSLHL_time(6, 8, false) → "6:08 PM"

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

public String quiz2021_12_08_APSLHL_time(int hours, int minutes, boolean AM) { }

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

Copyright Nick Parlante 2017 - privacy