GradeQuiz File Input Example

Describes how to read and score student quiz results where students submitted text-only files to a common handin folder.

Quiz Questions

  1. What is your login name?
  2. What is Deb's email address
  3. What is the sum of 4 + 47.3?

Text-only File Format that our program will read

1. login_name
2. email_address
3. value

File System - directory structure for our student quiz files

handin/
handin/deppeler.quiz1
handin/hasti.quiz1
handin/skrentny.quiz1

To create folders or text-only data files in Eclipse

  1. Open Eclipse
  2. Select (highlight) the project that will need to read the file
  3. Select File from the menu bar.
  4. Select New from the File menu.

4.a) Create a Folder

  1. Select Folder
  2. Type a name for the folder. (ie.  handin )
  3. Press Enter keyto save the newly created folder.

4.b) Create a text-only file

  1. Select Untitled text file to create a text-only file.
  2. Type the contents of the file (student's answers) in the file editor window.  Follow the file format above if you want to read the file with the example code.
  3. Select File -> Save As
  4. Select the folder (ie. the handin folder you just created)
  5. Type the name of the file.
  6. Press Enter to save the newly created file.

class GradeQuiz (PSEUDOCODE)

data files used in class

coded Examples:

© 2014 Debra Deppeler, All rights reserved.