Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CS240 Intro Engineering Programming Programming Assignment #5 Due Monday, October 22 nd , by midnight Topics: User defined functions, for loops, find command An Instructor

CS240 Intro Engineering Programming

Programming Assignment #5 Due Monday, October 22nd, by midnight

Topics: User defined functions, for loops, find command

An Instructor has requested you write two functions to adjust the grades based on the current score that will be sent to the function in a scalar or a vector. It will then print a report that will show the original score and the new score. It will return a scalar or a vector (same as the one sent to the function) with the adjusted score. These functions will be call Sample_for and Sample_find. Both functions will adjust the scores for the returned value as follows:

Score

New Score

0-25

+10%

25-50

+8%

50-75

+ 5%

75-100

+ 3%

< 0 or >100

+ 0%

Sample_for MUST use a for loop and Sample_find MUST use the find command.

To test your functions, you will have to create a vector to send to the functions. Use

x = -20:10:120; %creates a vector to test your functions.

Then call them using the following commands:

Sample_for(x);

Sample_find(x);

Notes(s):

Sample Run(s):

Upload BOTH function files (Sample_for and Sample_find) to D2L's (Program 05) Dropbox. Due date is Monday, October 22nd, by midnight.

>> x = -20:10:120

>> Sample_find( x )

Sample_find Results

Score Adjusted Score

-------------------------------------------

-20.00 -20.00

-10.00 -10.00

0.00 0.00

10.00 11.00

20.00 22.00

30.00 32.40

40.00 43.20

50.00 54.00

60.00 63.00

70.00 73.50

80.00 82.40

90.00 92.70

100.00 103.00

110.00 110.00

120.00 120.00

>> Sample_for( x )

Sample_for Results

Score Adjusted Score

------------------------------------------

-20.00 -20.00

-10.00 -10.00

0.00 0.00

10.00 11.00

20.00 22.00

30.00 32.40

40.00 43.20

50.00 54.00

60.00 63.00

70.00 73.50

80.00 82.40

90.00 92.70

100.00 103.00

110.00 110.00

120.00 120.00

>>

Note: there are answers for this code in the website but I want a new code please i dont want the same answers from the website.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Probability & Statistics For Engineers & Scientists

Authors: Ronald E. Walpole, Raymond H. Myers, Sharon L. Myers, Keying

7th Edition

9789813131279, 130415294, 9813131276, 978-0130415295

Students also viewed these Databases questions