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

 

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

Write a method that returns an array consisting of all the positive multiples of 'multsOf' up to, and possibly including, 'max'. Note that 'max' is ONLY included if 'max' is a multiple of 'multsOf'. Look at the test data for examples. As preconditions, you may assume that multsOf>0 and max>=multsOf


quiz2023_05_31_P1SL_listMults(28, 144) → [28, 56, 84, 112, 140]
quiz2023_05_31_P1SL_listMults(4, 29) → [4, 8, 12, 16, 20, 24, 28]
quiz2023_05_31_P1SL_listMults(5, 30) → [5, 10, 15, 20, 25, 30]

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

public int[] quiz2023_05_31_P1SL_listMults(int multsOf, int max) { }

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

Copyright Nick Parlante 2017 - privacy