CS 1073 Introductory Programming
|
Question: Here is a practice problem:
loop problem.
Solution.
(Don't access until you've tried the problem.)
// initialize array named primes to the first 7 primes
int[] primes = {2, 3, 5, 7, 11, 13, 17};
Question: Use a for loop to add up the squares of the primes
stored in the array in 2 above. Print the sum.
Solution.
(Don't access until you've tried the problem.)
int[] a = new int[25]; for (int i = 0; i < a.length; i++) a[i] = 0;
Question: Here is a practice problem:
Problem involving arrays.
Solution.
(Don't access until you've tried the problem.)
Question: Here is a practice problem:
Problem involving strings.
Solution.
(Don't access until you've tried the problem.)
Question: Here is a practice problem:
Problem involving classes.
Solution.
(Don't access until you've tried the problem.)
Question: Here is a practice problem:
12 days of Christmas.
Solution.
(Don't access until you've tried the problem.)
Question: Here is an approximation problem:
Approximate pi.
Solution.
(Don't access until you've tried the problem.)