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

 

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

Write a method that has five integer parameters: startHour, startMinute, classLength, travelTime, numClasses. The method returns a string showing the start time in hours and minutes of each of seven class periods. For example: schedule(7, 30, 55, 5, 6) would return "[1]7:30 [2]8:30 [3]9:30 [4]10:30 [5]11:30 [6]12:30." Notice that there is one spaces after each time, except for the last time which has a period after it. All of the integer parameters will be positive numbers and the startHour and startMinute will represent a valid time.


schedule(12, 1, 17, 6, 4) → "[1]12:01 [2]12:24 [3]12:47 [4]1:10."
schedule(7, 15, 355, 15, 2) → "[1]7:15 [2]1:25."
schedule(7, 29, 42, 7, 7) → "[1]7:29 [2]8:18 [3]9:07 [4]9:56 [5]10:45 [6]11:34 [7]12:23."

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

public String schedule(int startHour, int startMinute, int classLength, int travelTime, int numClasses) { }

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

Copyright Nick Parlante 2017 - privacy