i wanna some one knows how to write python program

profileoiqmaf50j
untitled.pdf

 

CSCI 1170­003 

Open Lab 6 (OLA6): Autograding Exam  

Due: ​Monday, November 30th, by 10:20am  Assignment code: ​ola6 

 

LAB GOALS: 

● File Reading and Writing  ● Using Lists  ● Processing Strings  ● Using Accumulators 

    LAB DESCRIPTION: 

This is your chance to step into the shoes of a busy instructor!  Your students have taken their final exam, and their  answers have been saved to a file called ‘testresults.txt’.  The answers to this exam are stored in a second file called  ‘answerkey.txt’.      It is your job to write a Python program that will read the answer key file and the test results file, automatically grade  each students exam, save the results to an output file, and print some statistics on the final grades. 

    HELPFUL DETAILS: 

The input file ‘answerkey.txt’ will have only 1 line of text consisting of 20 letter choices, each separated by a comma.  (See example on next page) 

  The input file ‘testresults.txt’  will have between 10 and 50 lines of text.  Each line will consist of a student ID (a mix of  numbers and letters), followed by 20 letter choices that represent the students answers on the exam.  All data will be  separated by commas.  (See example on next page). 

  The first letter choice in the ‘testresults.txt’ file must match the first letter choice in the ‘answerkey.txt’ file for this answer  to be correct.  This continues with the second letter choice in the ‘testresults.txt’ file must be equal to the second letter  choice in the ‘answerkey.txt’ file, and so on.  Since there are 20 questions on this exam, each correct answer is worth  5% of the student's grade.  Therefore, if a student got 18 of 20 answers correct, they would make a 90% on the exam. 

  PASS/FAIL will be determined as follows:  any grade that is greater than or equal to 60% passes the exam.   

  LETTER GRADE will be determined as follows:  100­90% is an A, 89­80% is a B, 79­70% is a C, 69­60% is a D, and  below 60% is an F. 

  OUTPUT FILE will contain as many lines as exist in the ‘testresults.txt’ file (one for each student id).  You will output the  following data:    STUDENT ID, Exam Grade (in Percentage), Pass or Fail, and Letter Grade.  All four of these fields will  be output on a single line separated by commas, one line per student ID.  An example line might look like: 

c117044,75%,PASS,C  (See example output file results on following pages) 

  EXAM STATISTICS will be printed to the screen after all the files have been processed.  The printed output will  contain:   

1.) A List of each letter grade followed by the number of students who achieved this.  2.) The Maximum grade scored by any student  3.) The Minimum grade scored by any student  4.) The Average grades scored across the class. 

The average grade should be formatted to include one decimal place.  An example of this printout can be found in the  next pages.       

 

CSCI 1170­003 

Open Lab 6 (OLA6): Autograding Exam  

Due: ​Monday, November 30th, by 10:20am  Assignment code: ​ola6 

 

ADDITIONAL DETAILS​:   

 

PLEASE read the entire lab write­up AND the grading rubric carefully!    I do 

not want to have to take off points for a missing header or missing comments! 

Make sure you are covering all of the programming requirements. 

 

  You may write your own functions to solve this problem.   Make sure all functions are defined in Hierarchical Order and 

include comments that describe their functionality.   

You are to define a main() function that contains the mainline program logic, and call this main() function at the bottom  of your program file.   

I recommend breaking this project up into smaller pieces instead of trying to solve it all at once.  First, make sure you  can read the input files and convert them into useable data structures.   Second, try to process the grades and print all results to  the screen before trying to write the results to the file.  Once you feel your grading algorithm is working properly, then write the  code that will save the results to an output file.     

 

FINAL NOTE:  You may not work with other students on this program.  This is a complex enough lab that it is highly unlikely that any two students 

will use the exact same approach.  Please do not risk sharing / borrowing 

code on this assignment!   

    If you have any questions on this lab assignment, please do not hesitate to see the instructor.    Good luck!           

 

CSCI 1170­003 

Open Lab 6 (OLA6): Autograding Exam  

Due: ​Monday, November 30th, by 10:20am  Assignment code: ​ola6 

 

THE INPUT FILES    Example of ​answerkey.txt​  (you will read this file)  Copy this file to your working directory using the command   ​cp ~mcm7f/shared/answerkey.txt .

A,B,A,C,A,D,E,E,A,C,A,D,A,B,A,A,D,E,A,C

      Example of ​testresults.txt ​ (you will read this file)  Copy this file to your working directory using the command   ​cp ~mcm7f/shared/testresults.txt .  

c117040,A,B,A,D,A,A,E,E,A,B,A,A,A,B,A,A,D,A,A,C c117041,A,D,A,B,A,D,E,E,D,C,A,D,A,B,D,D,D,E,A,C c117042,E,D,A,C,A,D,B,E,A,C,B,D,A,B,A,A,D,E,A,C c117043,D,B,A,D,A,D,A,E,E,C,C,B,A,B,A,A,D,E,A,E c117044,A,B,D,C,A,D,E,E,A,C,A,D,A,D,A,A,C,E,A,C c117045,A,B,A,C,A,D,E,E,A,C,A,B,A,B,A,E,D,E,A,B c117046,A,B,A,A,A,D,E,B,A,E,D,D,A,B,A,A,D,E,A,C c117047,A,B,A,E,A,D,B,E,A,C,A,D,A,D,A,A,E,E,A,D c117048,A,E,A,C,B,D,E,D,A,C,D,D,D,B,A,A,D,A,A,C c117049,A,B,A,C,A,C,E,E,A,C,A,D,A,E,A,D,D,E,B,C c117050,A,B,B,C,E,D,C,E,A,C,A,A,B,B,C,A,C,E,A,C c117051,B,B,A,C,A,C,E,B,A,C,A,D,A,B,A,A,D,E,A,C c117052,C,B,C,C,D,D,E,E,B,C,A,D,A,B,A,A,D,C,A,D c117053,A,B,C,C,A,B,E,E,A,C,B,D,A,B,A,C,D,E,B,C c117054,A,B,A,C,C,D,E,E,C,C,A,E,D,B,C,C,D,E,A,B c117055,A,B,A,C,A,D,A,E,A,D,A,D,A,B,A,A,E,E,A,C c117056,A,A,A,A,A,D,E,E,A,C,A,D,D,B,A,A,D,D,A,C c117057,A,E,A,C,A,D,B,E,A,E,A,B,C,B,A,E,D,E,E,C c117058,A,B,A,C,D,E,E,B,A,C,C,C,A,B,A,A,D,E,A,C c117059,E,B,A,C,A,D,E,E,A,C,A,D,A,B,B,C,D,E,A,C c117060,C,B,B,E,A,C,E,E,A,C,D,D,A,E,A,A,E,E,D,C c117061,E,B,E,B,A,D,E,E,A,C,A,C,A,B,A,A,D,E,A,C c117062,A,B,A,C,A,D,E,E,A,C,A,D,A,B,A,A,D,B,A,C c117063,A,C,A,A,A,C,E,A,A,C,C,D,A,B,D,A,C,B,E,A c117064,A,B,D,C,A,D,E,E,A,C,A,D,A,B,A,C,D,E,A,B c117065,A,B,A,D,C,B,E,E,A,C,A,D,E,B,A,A,B,E,A,C c117066,A,B,A,C,A,D,D,E,A,C,A,D,A,B,A,A,C,E,A,E c117067,A,B,A,C,A,D,E,E,A,C,A,D,A,B,A,A,D,E,B,C c117068,A,B,D,C,A,C,E,E,B,C,B,D,A,B,B,A,D,E,A,A c117069,A,B,A,C,B,C,B,E,A,B,A,D,D,B,A,A,D,E,A,B c117070,A,B,A,C,A,D,A,E,C,D,A,D,C,B,C,A,D,E,A,C 

       

 

CSCI 1170­003 

Open Lab 6 (OLA6): Autograding Exam  

Due: ​Monday, November 30th, by 10:20am  Assignment code: ​ola6 

 

THE OUTPUT FILES    Example of ​graderesults.txt ​ (you will create this file) 

c117040,80%,PASS,B c117041,85%,PASS,B c117042,80%,PASS,B c117043,50%,FAIL,F c117044,75%,PASS,C c117045,75%,PASS,C c117046,85%,PASS,B c117047,75%,PASS,C c117048,80%,PASS,B c117049,85%,PASS,B c117050,75%,PASS,C c117051,80%,PASS,B c117052,85%,PASS,B c117053,80%,PASS,B c117054,75%,PASS,C c117055,95%,PASS,A c117056,75%,PASS,C c117057,65%,PASS,D c117058,70%,PASS,C c117059,80%,PASS,B c117060,70%,PASS,C c117061,80%,PASS,B c117062,80%,PASS,B c117063,55%,FAIL,F c117064,70%,PASS,C c117065,80%,PASS,B c117066,65%,PASS,D c117067,80%,PASS,B c117068,80%,PASS,B c117069,75%,PASS,C c117070,55%,FAIL,F

  You will print these results at the end of you file processing. 

A - 1 B - 15 C - 10 D - 2 F - 3 Maximum Grade: 95 Minimum Grade: 50 Average Grade: 75.5

 

 

CSCI 1170­003 

Open Lab 6 (OLA6): Autograding Exam  

Due: ​Monday, November 30th, by 10:20am  Assignment code: ​ola6 

 

  HOW TO TURN IN: 

  There will be ​THREE​ components used in determining the grade for this lab.   

1.) Save your python script as ‘ ​ola6.py ​’ in your ​OLA ​ directory.  You must submit your ola6.py file using ​turnin ​(instructions  below) by ​Monday, November 30th by 10:20am ​.  ​Late files will NOT be accepted, ​and only your submitted program  will be tested and graded. 

2.) Hand in a printed copy of your ola6.py file.    3.) Hand in a self­graded copy of this lab’s rubric (located on the last page).   

      USING TURNIN: 

Once you are ready to submit your ola6.py file, you will need to use the ​turnin​ command.  1.) In the UNIX terminal, navigate to the same directory as your ola6.py file.  2.) At the $ UNIX prompt, to submit your program you should type: 

turnin mcm7f ola6 ola6.py   

Notes:  To verify that you have submitted successfully, you may type the command:  turnin mcm7f ola6 

  If you see the response: 

project code: ola6  due date and time: 2015­11­30 10:20  userid: <your id>  file not found (not yet submitted) 

  Then your file was ​not​ successfully submitted.