{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# hw3 - the letter grade to the user Assume the grades are...

This preview shows pages 1–2. Sign up to view the full content.

CSC 113 Homework Assignment 3 Assigned September 27, 2010; Due October 4, 2010. 1. Write a M ATLAB function file that computes a plots 5 cycles of a sine wave as a function of time: y ( t ) = A sin(2 π ft + φ ) . The inputs to this function should be: (i) the amplitude A of the sine wave; (ii) the frequency f of the sine wave; and (iii) the phase angle φ of the sine wave. The output should be two vectors. One should be a vector of time values t spanning five cycles, and the other should be a vector containing the sine wave values y ( t ). Your code should also plot y versus t from within the function. Test your function using four or five different sine waves, before turning it in. 2. Write a M ATLAB function file that does the following: (a) The user inputs a vector of test grades. (b) The program excludes the minimum test grade and computes an average score based on the remaining grades. (c) Based on the average score so calculated, the program displays the letter grade to the screen (e.g., “The student grade is a B” or “The student grade is a D”), and outputs

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: the letter grade to the user. Assume the grades are calculated as A : 90-100 B : 80-90 C : 70-80 D : 60-70 F : < 60 If a student achieves the exact score of 70, 80, or 90, give him / her the higher grade. To turn in your homework. concatenate the two function scripts into a single text ﬁle, named lastname ¯ hw3.txt , which should look something like this: % CSC 13, Section 01, Homework 3, Your name function [y, t] = plotsine(A, f, phi) % % [y, t] = plotsine(A, f, phi) % % plots five cycles of a sine wave with amplitude A % frequency f, and phase phi (in radians), and returns two vectors % y and t which contain, respectively, the sine wave values % and the time instants spanning five cycles. % . . . end function avg ¯ grade(scores) % % avg ¯ grade(scores) calculates the average grade from an input vector % containing test scores. % . . . end % End of file The vertical dots indicate where you have to ﬁll in the code....
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

hw3 - the letter grade to the user Assume the grades are...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online