http://math.hws.edu/eck/cs124/javanotes8/c3/exercises.html
h
III.
dcccd.blackboard.com
< >
Chapter 2 & 3
Midterm
Midterm (Chapter 1-3)
(#1 – 6 are 20 pts. each, 7-11 are 4 pts. each for a total of 200 points) Good Luck! You can do it! As usual, please do tutoring for any questions.
1. Modify Programming Exercise 3.1. How many times to roll 3 dice to get 3 “1”s? How many times to roll either 7 or 11?
2. Modify Programming Exercise 3.2. Print out all of the integers that meet the requirements, not just one of them.
3. Modify Programming Exercise 3.3. Catch the error if the user enters an operator where a number should be.
4. Modify Programming Exercise 3.4. Check for apostrophe (we did this is lecture).
5. Modify Programming Exercise 3.5. Report the average sales per city. Cities with no data get a zero for computing the average sales.
6. Modify Programming Exercise 3.6. Print all of the prime integers between 1 and 100.
7. Explain the following code statement:
for (i = 0; i