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

 

frew@mclean.com unit3virtualday2 > nth
prev  |  next  |  chance

Determine the nth term of a geometric sequence given the first term, and ratio. The formula is a_n = a_1 times r ^(n - 1)


nth(3.0, 5.0, 9) → 1171875.0
nth(3.0, 2.0, 8) → 384.0
nth(4.0, 3.0, 8) → 8748.0

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

public double nth(double a_1, double r, int n) { }

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

Copyright Nick Parlante 2017 - privacy