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

 

apcsaArraysCreateThree


Given an input int num, create and return a new array of three int values, as follows.


-Index 0 should hold the value num.

-Index 1 should hold num + 10.

-Index 2 should hold (3 * num + 10) % num.

Precondition: num != 0

apcsaArraysCreateThree(5) → [5, 15, 0]
apcsaArraysCreateThree(-5) → [-5, 5, 0]
apcsaArraysCreateThree(37) → [37, 47, 10]

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

public int[] apcsaArraysCreateThree(int num) { }

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

Copyright Nick Parlante 2017 - privacy