{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

LECTURE_7_CS113_2010

# LECTURE_7_CS113_2010 - CS113 Introduction to Computing for...

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

1 CS113 Introduction to Computing for Engineers Logical Operators and Conditional Statements

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

View Full Document
2 Programming in Matlab
3 Programming in Matlab

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

View Full Document
4 Programming in Matlab
5 Programming in Matlab

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

View Full Document
6 Programming in Matlab
7 Programming in Matlab

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

View Full Document
8 Programming in Matlab
9 Programming in Matlab

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

View Full Document
10 Programming in Matlab
11 Programming Example #1 1. Problem Definition Write a Matlab function file that computes the average grade based on a vector of test grades entered by the user. If the student did not pass the class (i.e. average grade < 60) then display the message “The student did not pass the course.” 2. Problem Analysis User Input: vector of numbers that represent test grades User Output: average test grade and message if the student did not pass the course Equations: Average = (sum of test grades) / (number of exams)

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

View Full Document
12 Programming Example 3. Develop Algorithm (processing steps to solve problem) Output to the user the average grade User inputs a vector of test grades. Assign that input vector the variable “grades” Determine the number of exams (Nexams) Compute the average grade AverageGrade=sum(grades)/Nexams Is Average<60? yes Display message “Student failed the class!” no

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.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern