about | help | code help+videos | done | prefs |
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) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 240
Copyright Nick Parlante 2017 - privacy