Intro Example:  Suppose in a theater the first row has 11 seats.  Every row after that has 2 more seats than the previous row.  How many seats are on the 13th row?  


To answer this, we can use the understanding of an arithmetic sequence.  An explanation for an arithmetic sequence is given below.  Once you understand the concept, you can come back and determine how many seats are on the 13th row.


Arithmetic Sequence: A sequence of numbers that have a common difference.  In the example below, the common difference (defined by the difference in a value in the sequence – the previous value in the sequence) is -50.

With the first value in the sequence (200) and the common difference (-50), we can determine any number in the sequence (the nth term).


Project 7: Variables 'firstVal', 'dif', and 'n' have been initialized.

firstVal represents the first value in the arithmetic sequence (200 in the example above)

dif represents the common difference in the arithmetic sequence (-50 in the example above)

n represents the term in the sequence that we are finding the value of.

example: if n = 4 for the previous example, our value would be 50.

Task: Appropriately assign the value of 'value' to be the nth term of the sequence given.

**If your code works for 5 test cases, you can enter your e-mail address

Universal Computational Math Methods:

pow(5,2) returns 25.0

abs(-3.0) returns 3

sqrt(49.0) returns 7.0