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

 

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

Input parameters: ding = the number of times a bell will ding. ring = the number of rings in a cycle. ringCyclesPerDing = the number of complete ring cycles that will happen for each ding. The new school bell system is very strange. A bell will "ding" followed by a cycle of "rings" that will repeat, with a short pause between each cycle, for ringCyclesPerDing number of times for each time the other bell dings. For example, ding=2, ring=4, ringCyclesPerDing=3 would cause the bells to ring like this: ding, ring, ring, ring, ring, (pause), ring, ring, ring, ring, {pause}, ring, ring, ring, ring, {pause}, ding, ring, ring, ring, ring, (pause), ring, ring, ring, ring, {pause}, ring, ring, ring, ring. Return an array that contains the total number of times the bell will "ding" followed by the total number of times the bell will "ring". Note that all of the input parameters will be reasonably small non-negative integers.


countDingRing2(12, 4, 15) → [12, 720]
countDingRing2(4, 5, 2) → [4, 40]
countDingRing2(17, 2, 1) → [17, 34]

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

public int[] countDingRing2(int ding, int ring, int ringCyclesPerDing) { }

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

Copyright Nick Parlante 2017 - privacy