Officer Jenny is in charge of training new police recruits. She just gave her students a multipe-choice quiz. She wants to produce a summary of student performance for all questions where fewer than 60% of the recruits got the question right. Write a program to accomplish this task. Using Numpy Arrays Although in principle this question could be solved using lists only. our goal is to gain practice working with arrays. Therefore, you must convert the quiz data to an array and perform all calculations using array operations. Before you start anything., make sure you have imported the numpy module. This module is NOT standard, so if you are working on your own machine, you may need to install it first. Quiz Data A starter file is provided for you that contains the quiz data as a list-of-lists. The data is organized such that each sublist represents the quiz result for a single student. Each sublist is the same length and contains multiple integers, indicating the student's score on each question on the quiz. A value of 1 means the student got the question right and O means the student got the question wrong. The program you hand in should compute the result for the quizResults list, but two other very small lists are provided to help you perform simple testing. For example, test1 represents a quiz with just 2 questions that was written by 3 students, where all 3 students got the first question wrong. Program Behaviour Your program should: (a) Create a 2D array from the list of lists for a quiz. Your program should work no matter how many students there are, or how many questions in the quiz. (b) For each question, calculate the percentage of students who answered incorrectly • If fewer than 60% answered correctly, print the information (performance and question number) for that question to the console Take advantage of the power of arrays to do this! In particular, you can slice a 2D array across multiple dimensions; think about how this might be useful.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
[
# testl =
# [о, 0],
# [о, 1],
# [о, 1]
# ]
[
# [1, 1, 1, 1],
# [о, 1, 0, 0],
# [1, 1, 0, 1],
# [о, 1, 0, 1],
# [1, 1, 1, 1]
# ]
# test2
[
qui zResul ts
[1, 1, 1, 1, 0, 1, 1, 1,
[о, 1, 0, 0, 1, 1, 1, 0,
[1, 1, 1, 1, 1, 0, 1, 0,
[1, 1, 0, 1, 1, 0, 0, 1, 1, 1],
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 0, 1, 1, 1, 1, 1, 0, 1, 1],
[1, 0, 0, 0, 0, 1, 0, 1,
[о, 1, 1, 1, 1, 1, 1, 0,
[о, 0, 1, 1, 1, 1, 1,
[1, 0, 0, 1, 1, 1, 1, 0,
[о, 1, 1, 1, 1, 1, 0, 1, 1, 1],
[о, 1, 1, 1, 1, 1, 1, 0, 1, 1],
[о, 1, 1, 1, 0, 1, 0, 1,
[1, 1, 0, 1, 1, 0, 1, 1, 1, 0],
[о, 0, 0, 1, 0, 1, 0, 0,
[о, 1, 0, 1, 1, 0, 1, 0,
[о, 1, 1, 1, 1, 1, 0, 0,
[о, 1, 0, 1, 1, 1, 1, 1,
[1, 0, 1, 1, 1, 1, 1, 0,
[о, 1, 0, 1, 0, 1, 0, 1,
1, 1],
0, 1],
1, 1],
1, 0],
1, 1],
1, 1, 1],
1, 1],
1, o],
0, 1],
1, 0],
0, 1],
1, 1],
0, ol,
0, 1]
Transcribed Image Text:[ # testl = # [о, 0], # [о, 1], # [о, 1] # ] [ # [1, 1, 1, 1], # [о, 1, 0, 0], # [1, 1, 0, 1], # [о, 1, 0, 1], # [1, 1, 1, 1] # ] # test2 [ qui zResul ts [1, 1, 1, 1, 0, 1, 1, 1, [о, 1, 0, 0, 1, 1, 1, 0, [1, 1, 1, 1, 1, 0, 1, 0, [1, 1, 0, 1, 1, 0, 0, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 1, 1, 1, 1, 1, 0, 1, 1], [1, 0, 0, 0, 0, 1, 0, 1, [о, 1, 1, 1, 1, 1, 1, 0, [о, 0, 1, 1, 1, 1, 1, [1, 0, 0, 1, 1, 1, 1, 0, [о, 1, 1, 1, 1, 1, 0, 1, 1, 1], [о, 1, 1, 1, 1, 1, 1, 0, 1, 1], [о, 1, 1, 1, 0, 1, 0, 1, [1, 1, 0, 1, 1, 0, 1, 1, 1, 0], [о, 0, 0, 1, 0, 1, 0, 0, [о, 1, 0, 1, 1, 0, 1, 0, [о, 1, 1, 1, 1, 1, 0, 0, [о, 1, 0, 1, 1, 1, 1, 1, [1, 0, 1, 1, 1, 1, 1, 0, [о, 1, 0, 1, 0, 1, 0, 1, 1, 1], 0, 1], 1, 1], 1, 0], 1, 1], 1, 1, 1], 1, 1], 1, o], 0, 1], 1, 0], 0, 1], 1, 1], 0, ol, 0, 1]
Officer Jenny is in charge of training new police recruits. She just gave her students a multipe-choice quiz.
She wants to produce a summary of student performance for all questions where fewer than 60% of the
recruits got the question right. Write a program to accomplish this task.
Using Numpy Arrays
Although in principle this question could be solved using lists only. our goal is to gain practice working
with arrays. Therefore, you must convert the quiz data to an array and perform all calculations using array
operations. Before you start anything, make sure you have imported the numpy module. This module is
NOT standard, so if you are working on your own machine, you may need to install it first.
Quiz Data
A starter file is provided for you that contains the quiz data as a list-of-lists. The data is organized such that
each sublist represents the quiz result for a single student. Each sublist is the same length and contains
multiple integers, indicating the student's score on each question on the quiz. A value of 1 means the
student got the question right and O means the student got the question wrong.
The program you hand in should compute the result for the quizResults list, but two other very small lists
are provided to help you perform simple testing. For example, testi represents a quiz with just 2 questions
that was written by 3 students, where all 3 students got the first question wrong.
Program Behaviour
Your program should:
(a) Create a 2D array from the list of lists for a quiz. Your program should work no matter how many
students there are, or how many questions in the quiz.
(b) For each question, calculate the percentage of students who answered incorrectly
• If fewer than 60% answered correctly. print the information (performance and question number)
for that question to the console
Take advantage of the power of arrays to do this! In particular, you can slice a 2D array across multiple
dimensions; think about how this might be useful.
Transcribed Image Text:Officer Jenny is in charge of training new police recruits. She just gave her students a multipe-choice quiz. She wants to produce a summary of student performance for all questions where fewer than 60% of the recruits got the question right. Write a program to accomplish this task. Using Numpy Arrays Although in principle this question could be solved using lists only. our goal is to gain practice working with arrays. Therefore, you must convert the quiz data to an array and perform all calculations using array operations. Before you start anything, make sure you have imported the numpy module. This module is NOT standard, so if you are working on your own machine, you may need to install it first. Quiz Data A starter file is provided for you that contains the quiz data as a list-of-lists. The data is organized such that each sublist represents the quiz result for a single student. Each sublist is the same length and contains multiple integers, indicating the student's score on each question on the quiz. A value of 1 means the student got the question right and O means the student got the question wrong. The program you hand in should compute the result for the quizResults list, but two other very small lists are provided to help you perform simple testing. For example, testi represents a quiz with just 2 questions that was written by 3 students, where all 3 students got the first question wrong. Program Behaviour Your program should: (a) Create a 2D array from the list of lists for a quiz. Your program should work no matter how many students there are, or how many questions in the quiz. (b) For each question, calculate the percentage of students who answered incorrectly • If fewer than 60% answered correctly. print the information (performance and question number) for that question to the console Take advantage of the power of arrays to do this! In particular, you can slice a 2D array across multiple dimensions; think about how this might be useful.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education