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

 

tmhscs@gmail.com competition > HPCW2020_09_VinylRecords
prev  |  next  |  chance

Vinyl Records
Problem 09
Worth 5 Points

With vinyl records making a comeback, industry executives
need to hire a programmer to tell their factory machines
when to flip the record, as all of their original equipment was
destroyed during the rise of the CD. Help your company turn
the tables on the industry!

Input:

The factory machine will receive a data line
composed of two integers. The first integer is the total
number of minutes for the recording. The second integer is
the total number of seconds.

Output:

The vinyl records your company presses can hold 25 minutes of audio on one side. Output to the data
operator's screen the remaining time on the record as follows:

Given an input recording of 17 minutes and 5 seconds, output:
"Time remaining 32 minutes and 55 seconds"

Given an input recording of 26 minutes and 33 seconds, output:
"Time remaining 23 minutes and 27 seconds (we'll need both sides)"

Given an input recording of 61 minutes and 1 second, output:
"Time remaining -1 minutes and -1 seconds (we're gonna need a bigger record)"

If the recording will exceed the amount of time one side can contain, add " (we'll need both sides)" to the output
for the operator to see. However, if the recording will exceed the total amount of time an entire record can
contain, add "(we're gonna need a bigger record)" to the output instead.

HPCW2020_09_VinylRecords(17, 5) → "Time remaining 32 minutes and 55 seconds"
HPCW2020_09_VinylRecords(26, 33) → "Time remaining 23 minutes and 27 seconds (we'll need both sides)"
HPCW2020_09_VinylRecords(51, 1) → "Time remaining -1 minutes and -1 seconds (we're gonna need a bigger record)"

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

public String HPCW2020_09_VinylRecords(int minutes, int seconds) { }

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

Post-solution available

Copyright Nick Parlante 2017 - privacy