A matrix named Marks has three columns (could have any number of rows). The first column...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
A matrix named Marks has three columns (could have any number of rows). The first column stores the student ID, the second column stores the unit ID and the third column stores the grade (all the value in Marks are numeric). For example, 6 Marks = [1234112 4140 1274814 4710 1538116 4140 1134215 4140 1534193 4180 67 76 36 77 69 POH ...] Note: the above values are just an example. Marks matrix can have any number of rows and different values, but with the above format. Write a function that takes in such a matrix and a unit code as the inputs and calculates the percentage of students who passed the given unit. A student is passed if the grade is 50 or above. The output of the function is the calculated pass percentage. The Pass percentage is defined as: Pass percentage = (number of passed students)/ (total number of students) * 100 If there are no students who had taken the given unit, then the output of the function should be 0. Copy and paste your function below. Paste as plain text (Ctrl+Shift+V) if normal paste (Ctrl+v) doesn't work. A matrix named Marks has three columns (could have any number of rows). The first column stores the student ID, the second column stores the unit ID and the third column stores the grade (all the value in Marks are numeric). For example, 6 Marks = [1234112 4140 1274814 4710 1538116 4140 1134215 4140 1534193 4180 67 76 36 77 69 POH ...] Note: the above values are just an example. Marks matrix can have any number of rows and different values, but with the above format. Write a function that takes in such a matrix and a unit code as the inputs and calculates the percentage of students who passed the given unit. A student is passed if the grade is 50 or above. The output of the function is the calculated pass percentage. The Pass percentage is defined as: Pass percentage = (number of passed students)/ (total number of students) * 100 If there are no students who had taken the given unit, then the output of the function should be 0. Copy and paste your function below. Paste as plain text (Ctrl+Shift+V) if normal paste (Ctrl+v) doesn't work.
Expert Answer:
Answer rating: 100% (QA)
Here is a Python function to calculate the percentage of students who passed a given unit def calcul... View the full answer
Related Book For
Concepts of Database Management
ISBN: 978-1285427102
8th edition
Authors: Philip J. Pratt, Mary Z. Last
Posted Date:
Students also viewed these computer network questions
-
Write a leadership essay based on an Interview with a Healthcare Director. Objective of the leadership Interview. Write a Rationale for healthcare Director Selection. Synopsis of the interview....
-
Read the case study "Southwest Airlines," found in Part 2 of your textbook. Review the "Guide to Case Analysis" found on pp. CA1 - CA11 of your textbook. (This guide follows the last case in the...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
A school district comprises 24 schools. The numbers of students in each of the schools are as follows: The district wants to implement an experimental teaching and learning model for approximately...
-
Find a formula for a function that has vertical asymptotes x = 1 and x = 3 and horizontal asymptote y = 1.
-
The point (-14,8) is on the graph of y = f(x). Find the corresponding point on the graph of y = g(x), where g(x) = f(x) = 4. The corresponding point on the graph of y = g(x) is (Simplify your answer....
-
Consider the house price data in Table B.4. a. Fit a multiple regression model relating selling price to all nine regressors. b. Test for significance of regression. What conclusions can you draw? c....
-
A company preparing for a Chapter 7 liquidation has the following liabilities: Note payable A of $90,000 secured by land having a book value of $50,000 and a fair value of $70,000. Note payable B...
-
Question 1 Envelope Company began operations this month mass-producing pull-and-seal envelopes. During the month of July, it completed 25,000 units and has 20,000 units that are 65% complete. It had...
-
Company Selection and Financial Retrieval: Pick a public company that piques your interest. Obtain its latest financial statements. 2. Cash Flow Interpretation: Using the acquired financial data,...
-
Q1. In an experiment, equal volumes of dilute hydrochloric acid (solution A) and dilute sodium hydrochloric (solution B) of volume 20cm3 are mixed together to form solution C. I. II. III. IV. V. 20...
-
What type of project risk generally is the most measurable?
-
Describe the qualitative approach to risk assessment. Why does this approach, which does not rely on numerical data, work?
-
Why is it best to specify the target capital structure as a range rather than as a single value?
-
Santa Roberta Clinic has estimated its corporate cost of capital to be 11 percent. What are reasonable values for the project costs of capital for low-risk, average-risk, and high-risk projects?
-
How does a businesss target capital structure influence its financing decisions?
-
Let V and W be vector spaces, and let T: VW be a linear transformation. Given a subspace of V, let T(U) denote the set of all images of the form T(x), where x is in U. Show that T(U) is a subspace of...
-
Question 6.10 Current and deferred tax worksheets and tax entries From the hip Ltd?s statement of profit or loss for the year ended 30 June 2007 and extracts from its statements of financial position...
-
Why is system availability an advantage in a distributed database?
-
How can you get more information from the same amount of data by using a database approach instead of a non-database approach?
-
In Example 1, why is the data type for the Postal Code field CHAR and not SMALLINT or INTEGER? Is the length of the field long enough? Why or why not?
-
What is the change in velocity of \((a)\) cart 1 (b) cart 2 in Figure 4.6? (c) What do you notice about your two answers? Figure 4.6 Velocity-versus-time graph for two identical carts before and...
-
(a) Are the accelerations of the motions shown in Figure 4.1 constant? (b) For which surface is the acceleration largest in magnitude? Figure 4.1 Velocity-versus-time graph for a wooden block sliding...
-
The \(x\) component of the final velocity of the standard cart in Figure 4.8 is positive. Can you make it negative by adjusting this cart's initial speed while still keeping the half cart initially...
Study smarter with the SolutionInn App