class_notes4

# class_notes4 - Engineering 3 So far structure of programs...

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

Engineering 3 So far: structure of programs printf(), scanf() basic arithmetic decision making: if simple debugging algorithms Today: •e x a m p l e s •m o r e i f s sample problem basic arithmetic repetition: while Readings: Chaps 1 & 2, 3.1-3.7

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

View Full Document
if statements A simple example: write a program that prints ‘Passed’ if a students grade is > 60. Slightly more complicated: write a program that prints ‘Passed’ if a students grade is > 60, and ‘Failed’ otherwise. A bit more… : write a program that prints the letter grade corresponding to a students grade (eg. ‘A’ if grade >= 90, ‘B’ if grade >= ’80’…)
Logical Operators •AND Operator - && -returns true if both conditions are true •OR Operator - || -returns true if either conditions are true •NOT Operator - ! -reverses the truth/falsity of a statement

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

View Full Document
Problem Solution A windy example…
Problem Solution 1. State the problem clearly: Use linear interpolation to compute a new coefficient of lift for a specified flight path angle.

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 ]}

### Page1 / 8

class_notes4 - Engineering 3 So far structure of programs...

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

View Full Document
Ask a homework question - tutors are online