1. Creating a function: Let's follow the example we used in the week one coding lectures and create a function for calcu

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

1. Creating a function: Let's follow the example we used in the week one coding lectures and create a function for calcu

Post by answerhappygod »

1 Creating A Function Let S Follow The Example We Used In The Week One Coding Lectures And Create A Function For Calcu 1
1 Creating A Function Let S Follow The Example We Used In The Week One Coding Lectures And Create A Function For Calcu 1 (142.28 KiB) Viewed 11 times
Use the MatLab
1. Creating a function: Let's follow the example we used in the week one coding lectures and create a function for calculating a student's grade in a class. For three students, we have the the points earned on each assignment Exam 1 Exam 2 Final Quiz 1 Quiz 2 Quiz 3 HW 1 HW 2 HW 3 80 92 10 8 9 40 47 25 80 82 10 6 30 37 25 75 72 9 10 40 50 29 Student 190 Student 270 Student 3 70 10 where tests are out of 100 points, quizzes are out of 10 points, and the homeworks are out of 40,50,and 30 points, respectively. Furthermore, Exam 1 and Exam 2 are each worth 10% of the student's grade, the final is worth 35% of the student's grade, each quiz is worth 5%, and each homework is worth 10%. (a) Create a function that takes in a vector of assignment scores, • a vector containing the number of points each assignment was worth, and a vector containing the weights of each assignment. This function should return the student's weighted average. Recall, the formula for calculating a weighted average is 100 - Σwigi where g; is the ith grade and w, is the weight of 9₁. Both g; and w; should be percentages in decimal form. (b) Using your function, find the weighted average for each student and save the output as A1-A3.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply