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 the first 13 rows combined?


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


Series: A series is simply the sum of the various terms of a sequence.

 

Given the arithmetic sequence: 3.0, 7.0, 11.0, 15.0, 19.0, 23.0, 27.0

 

S(5) = 3.0 + 7.0 + 11.0 + 15.0 + 19.0 = 55.0


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


firstVal represents the first term in the arithmetic sequence (3.0 in the example above)

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

n represents the series index (5 in the example above because we wanted the sum of the first 5 terms)


Task: Initialize the value of the variable 'sum' to represent the arithmetic series described (the sum of the first 'n' terms of the arithmetic sequence that starts at 'firstVal' with common difference 'dif'

**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