Electronic Quiz - Data Structures - Homework, Exercises of Data Structures and Algorithms

key points of Data Structures are: Electronic Quiz, Elearning, Professor, Extracting, Directories, Student File, Correct Answers, Inside, Generate, Report

Typology: Exercises

2012/2013

Uploaded on 04/30/2013

naji
naji 🇮🇳

4.3

(6)

87 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Homework #2 Data Structures
Electronic Quiz Grader Program
The eLearning multiple-choice-quiz grader has broken down, so Professor Smart N. Lazy wants you to write a
program (quizGrader.py) to grade the class’s eLearn quizzes. After extracting the files from:
/
you will find that the hw2 folder contains:
students.txt - a text file containing the student names in the class
one or more quiz# directories - each directory contains an answers.txt text file with the correct answers
and text files for the students who took the quiz. The student file names are lastname_firstname.txt
hw2
students.txt
Doe, Jane
Jones, Tom
Kidd, Billy
Smith, Sally
quiz1 quiz7
answers.txt answers.txtdoe_jane.txt doe_jane.txt
smith_sally.txt smith_sally.txt
A DC AA D
B BB BB A
A BA AB
C AC CC B
. . .
. . .
. . .
B
B B C
Your program should run from inside the hw2 directory to generate a gradeReport.txt file that looks
something like:
Student Quiz Report
Total Overall
Student Quiz Points Quiz %
-------------------------------------------
Doe, Jane 30 71.4
Jones, Tom 40 95.2
Kidd, Billy 35 83.3
Smith, Sally 36 85.7
Points Possible 42
For extra credit, you can report more details (e.g., individual quiz scores for each student):
Student Quiz Report
Total Overall
Student Quiz 1 Quiz 2 Quiz 7 Quiz Points Quiz %
--------------------------------- ... -------------------------------
Doe, Jane 3 5 2 30 71.4
Jones, Tom 4 6 5 40 95.2
Kidd, Billy 3 4 4 35 83.3
Smith, Sally 3 6 1 36 85.7
Points Possible 4 7 5 42
Save and run your program (called quizGrader.py) in the hw2 folder.
Name:____________________
Docsity.com
pf2

Partial preview of the text

Download Electronic Quiz - Data Structures - Homework and more Exercises Data Structures and Algorithms in PDF only on Docsity!

Homework #2 Data Structures

Electronic Quiz Grader Program

The eLearning multiple-choice-quiz grader has broken down, so Professor Smart N. Lazy wants you to write a program (quizGrader.py) to grade the class’s eLearn quizzes. After extracting the files from: / you will find that the hw2 folder contains:  students.txt - a text file containing the student names in the class  one or more quiz# directories - each directory contains an answers.txt text file with the correct answers and text files for the students who took the quiz. The student file names are lastname_firstname.txt

hw

students.txt Doe, Jane Jones, Tom Kidd, Billy Smith, Sally

quiz1 quiz

answers.txt doe_jane.txt smith_sally.txt answers.txt doe_jane.txt smith_sally.txt A C A D A D B B B B B A A A B B A C C C A C B

B

B B C

Your program should run from inside the hw2 directory to generate a gradeReport.txt file that looks something like:

Student Quiz Report

Total Overall Student Quiz Points Quiz %


Doe, Jane 30 71. Jones, Tom 40 95. Kidd, Billy 35 83. Smith, Sally 36 85. Points Possible 42

For extra credit , you can report more details (e.g., individual quiz scores for each student):

Student Quiz Report Total Overall Student Quiz 1 Quiz 2 Quiz 7 Quiz Points Quiz % --------------------------------- ... ------------------------------- Doe, Jane 3 5 2 30 71. Jones, Tom 4 6 5 40 95. Kidd, Billy 3 4 4 35 83. Smith, Sally 3 6 1 36 85. Points Possible 4 7 5 42

Save and run your program (called quizGrader.py) in the hw2 folder.

Name:____________________

Docsity.com

When you write your program, be sure you:  think about the functional-decomposition (top-down) design before you start to write code  use meaningful variable names with good style (i.e., useCamelCase)  use comments (""" Multi-line Comment """) at the start of the program and immediately after each function definition describing what they do (see lab1 diceOutcomes.py program)  use a main function (see lab1 diceOutcomes.py program) located at the top of program with a call to it at the bottom to start execution  use global constants where appropriate with good style (ALL_CAPS_AND_UNDERSCORES). (Put your global constants after your initial comments describing the program and before your main function definition so they can be found and changed easily in future versions of your program.)

Submit your homework electronically at https://www.cs.uni.edu/~schafer/submit/which_course.cgi

Submit the single file, hw2.zip containing the following:  quizGrader.py (your Python program)  design.doc (or design.pdf, or design.txt, or design.rtf) a document describing the design of your program including a functional-decomposition diagram with text describing each function (see lab1 description)  original data files and directories contained in hw2.zip downloaded (students.txt, etc.)

Name:____________________

Docsity.com