Home Teaching Research CV Timetable

Prev: P2 Next: P4
Back to week 5 page: Link



# P3 Programming Problem Instruction

📗 Enter your ID (the wisc email ID without @wisc.edu) here: and click (or hit enter key)
📗 The due date is Mar 2, late submissions within a week will be accepted without penalty, but please submit a regrade request form: Link.
📗 The same ID should generate the same set of questions. Your answers are not saved when you refresh the page or close the browser.
📗 To input your answers, you could (1) copy and paste your answers to the text boxes for individual questions, or (2) print your answers to text files and load them into the text boxes for individual questions, or (3) print all your outputs to a single text file and load it using the button at the bottom of the page under the Submission section. More details at the bottom of page W1.
📗 Please report any bugs on Piazza.

# Warning: please enter your ID before you start!



# Questions 1 to 4 Instruction

📗 Read a text file or a line of user input containing the grades of ??? quizzes and ??? programming homework (first all quiz grades first then all programming grades, comma separated). Create a matrix with three columns, the first column contains the students' average quiz grades, the second column contains the students' average programming homework grade, and the last column contains the students' final course grade, and one row for one student. Use the grading scheme specified in each question. Enter the matrix you created in the text box below each question.
📗 Note: you are allowed to use loops (for) and conditionals (if-else), but it is highly recommended that you do not use these, and vectorize instead, whenever you can. Details see: Doc.

# Question 1

📗 [1 point] Create the vector based on the user input: . The final grade is computed as ???, where \(q\) is the average quiz grade and \(p\) is the average homework grade.
📗 Answer:


# Question 2

📗 [1 point] Create the vector based on the user input: . The final grade is computed as ???, where \(q\) is the average quiz grade and \(p\) is the average homework grade. Also suppose that lowest quiz grade and the lowest homework grade are dropped when computing the averages.
📗 You can use the grades that are sorted:
📗 Answer:


# Question 3

📗 [1 point] Create the matrix based on the data text file: . The final grade is computed as ???, where \(q\) is the average quiz grade and \(p\) is the average homework grade.
📗 Answer:


# Question 4

📗 [1 point] Create the matrix based on the data text file: . The final grade is computed as ???, where \(q\) is the average quiz grade and \(p\) is the average homework grade. Also suppose that lowest quiz grade and the lowest homework grade are dropped when computing the averages.
📗 You can use the grades that are sorted: .
📗 Answer:


# Questions 5 to 9 Instruction

📗 Read a text file or a line of user input containing the grades points (either 0.0 to 4.0 or A to F) and the number of credits for an arbitrary number of courses (comma separated, each line has the format: [grade for course 1, number of credits for course 1, grade for course 2, number of credits for course 2, ..., grade for course n, number of credits for course n], and a pair [0, 0] or [N, 0] does not count as a course). Create a matrix with three columns, the first column contains the total number of courses the students take, the second column contains the total number of credits the students take, and the last column contains the students' GPA, and one row for one student. Enter the matrix you created in the text box below each question.
📗 Use the letter grade to grade point conversion scheme: . Details see: Wikipedia.
📗 Note: you are allowed to manually convert the letter grades to numeric grades, but it is recommended that you do all data processing in MATLAB, whenever you can.
📗 Note: you are allowed to use loops (for) and conditionals (if-else), but it is highly recommended that you do not use these, and vectorize instead, whenever you can. Details see: Doc.

# Question 5

📗 [1 point] Create the vector based on the user input (??? student and ??? courses): .
📗 Answer:


# Question 6

📗 [1 point] Create the vector based on the user input (??? student and ??? courses): .
📗 Answer:


# Question 7

📗 [1 point] Create the matrix based on the data text file (??? students and less than or equal to ??? courses): .
📗 Answer:


# Question 8

📗 [1 point] Create the matrix based on the data text file (??? students and less than or equal to ??? courses): .
📗 Answer:


# Question 9

📗 [1 point] Create the matrix based on the data text file (??? students and less than or equal to ??? courses): .
📗 Answer:


# Question 10

📗 [1 point] Please enter any comments and suggestions including possible mistakes and bugs with your version of the questions and the auto-grading, and materials relevant to solving the question that you think are not covered well during the lectures. If you have no comments, please enter "None": do not leave it blank.
📗 Answer: .

# Grade


 ***** ***** ***** ***** ***** 

 ***** ***** ***** ***** *****

# Submission



📗 Please do not modify the content in the above text field: use the "Grade" button to update.
📗 Warning: grading may take a few seconds. Please be patient and do not click "Grade" multiple times.


📗 You could submit multiple times (but please do not submit too often): the submission with the highest grade will be counted.
📗 Please also save the text in the above text box to a file using the button or copy and paste it into a file yourself .
📗 You could also load your answers from the text (or txt file) in the text box below using the button . The first two lines should be "##p: 3" and "##id: your id", and the format of the remaining lines should be "##1: your answer to question 1" newline "##2: your answer to question 2", etc. Please make sure that your answers are loaded correctly before submitting them.



📗 Saving and loading may take a few seconds. Please be patient and do not click "Load" multiple times.

# Code

📗 Please submit your code (.m, .txt, or .pdf are all acceptable) on Canvas Assignment P3.
📗 Your coding style and technique will not be graded, but please consider the following:
(1) Add comments to describe what the code is doing.
(2) Indent "for" loops and "if" blocks.
(3) Use descriptive but short variable names.
(4) Add white spaces and/or blank lines for readability.
📗 It is highly recommended that you use the commands and functions from the lectures, but you are allowed to use any built-in MATLAB commands and functions.
📗 Example solution: .m File, .txt File .pdf File.
(1) Please do not use the example solution as the starter code. You should write all the code yourself and only use the example solution as a reference when you get stuck.
(2) Please do not use the example solution as a guide for coding style. It is written so that it only solves a specific version of the problems. You code should be more general: you should define variables for constants, define functions for repetitive actions, and use descriptive variable names.
📗 Please report possible mistakes in the solution, and if you have better (shorter or more efficient) ways of solving the same problem, you can share your code on Piazza (but please do so after the due dates).
📗 If you use one or more lines of code from the example solution, other students in the class, or code you found on the Internet, you must give attribution by putting a comment at the beginning of your code submission, for example:
% Code attribution: P3 example solution.
% Code attribution: (student name)'s P3 solution.
% Code attribution: (student name)'s answer on Piazza: (link to Piazza post).
% Code attribution: (person name)'s answer on Stack Overflow: (link to page).






Last Updated: April 29, 2024 at 1:11 AM