Name: _________________________________
Objective:
For loops and reading counter files
Quiz:
- How many ovals are created
- What is printed by the following code?
for (int k = 1; k < 100; k += k-1) {
System.out.println(k);
}
- Describe the following");
for (;;) {
System.out.println("Same as it ever was");
}
- Syntax error
- Infinite loop
- Empty loop (never iterates)
- One-time loop (iterates just once)
Instructions
- Open your Averages project
- Import the files from Lab 11a File Averages II
- Your program will read a file of SAT scores. This file has as it's first line the number of SAT scores in the file. Therefore you can use a for loop to read in the data.
- Calculate the average of the values in the file.
Grading
| Feature |
Points |
Out of |
Notes |
| Quiz |
|
3 |
|
| Read loop |
|
5 |
|
| Averages |
|
2 |
|
| Total |
|
10 |
|
Notes
Comments (0)
You don't have permission to comment on this page.