# Programming

Item Name

### : Given the definition of SmallInt on page 588, determine

: Given the definition of SmallInt on page 588, determine whether the following addition expression is legal. If so, what addition operator is used? If not, how might you change the code to make it legal? SmallInt s1; double d = s1 + 3.14;

### "Animate" (as in §15.5) the series 1-1/3+1/5-1/7+1/9- 1/11- . .

"Animate" (as in §15.5) the series 1-1/3+1/5-1/7+1/9- 1/11- . . . . It is known as Leibniz's series and converges to pi/4.

### "Pretty up" the intrusive List example in §27.9 as best

"Pretty up" the intrusive List example in §27.9 as best you can to make it convenient to use. Do catch/handle as many errors as you can. It is fair game to change the details of the struct definitions, to use macros, whatever.

### "Tile" a window with small right triangles.

"Tile" a window with small right triangles.

### (a) Write an if statement that increases pay by 3%

(a) Write an if statement that increases pay by 3% if score is greater than 90. (b) Write an if statement that increases pay by 3% if score is greater than 90, otherwise increases pay by 1%.

### (Challenge) Repeat the previous project. but position the centers of

(Challenge) Repeat the previous project. but position the centers of the circles on a spiral. The center of each circle will depend on both an angle and a distance from the origin A constant change in both the angle and the distance will result in a spiral pattern.

### (Find the smallest n such that n2 > 12,000) Use

(Find the smallest n such that n2 > 12,000) Use a while loop to find the smallest integer n such that n2 is greater than 12,000.

### (Optional) Repeat the previous question, but use the comma operator

(Optional) Repeat the previous question, but use the comma operator and omit the for statement’s body.

### (Optional) Write a recursive method to compute the sum of

(Optional) Write a recursive method to compute the sum of the first N positive integers. Note: This is strictly for exercise. You should not write the real method recursively.

### (Reverse number) Write a program that prompts the user to

(Reverse number) Write a program that prompts the user to enter a four-digit integer and displays the number in reverse order. Here is a sample run: Enter an integer: 3125 The reversed number is 5213