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

 

davereed@creighton.edu csc222 > doubleUntil1
prev  |  next  |  chance

doubleUntil1 -- You are given two positive integers, num and goal, and want to repeatedly double the value of num until it reaches or exceeds goal. The method should return the final value of num.


doubleUntil1(1, 5) → 8
doubleUntil1(1, 8) → 8
doubleUntil1(1, 10) → 16

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

public int doubleUntil1(int num, int goal) { }

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

Copyright Nick Parlante 2017 - privacy