class_notes4

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

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full DocumentRight Arrow Icon
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’…)
Background image of page 2
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
Background image of page 3

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

View Full DocumentRight Arrow Icon
Problem Solution A windy example…
Background image of page 4
Problem Solution 1. State the problem clearly: Use linear interpolation to compute a new coefficient of lift for a specified flight path angle.
Background image of page 5

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

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

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 Right Arrow Icon
Ask a homework question - tutors are online