View
 

Lab 11a: File Averages II

Page history last edited by Mr. Kretsch 5 months, 2 weeks ago

Name: _________________________________

Objective:

For loops and reading counter files

Quiz:

  1. How many ovals are created
  2. What is printed by the following code?
for (int k = 1; k < 100; k += k-1) {
     System.out.println(k);
  1. 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

  1. Open your Averages project
  2. Import the files from Lab 11a File Averages II
  3. 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.
  4. 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.