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

 

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

Write a method that returns an array of the squares of all the integers from 0 to 'max' inclusive. For example, makeSquares(3) returns {0, 1, 4, 9} because those are the squares of the integers from 0 to 3 inclusive. Look at the test data for additional examples. Use an appropriate type of loop.


makeSquares(5) → [0, 1, 4, 9, 16, 25]
makeSquares(2) → [0, 1, 4]
makeSquares(0) → [0]

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

public int[] makeSquares(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: 240

Copyright Nick Parlante 2017 - privacy