Chapter 5

5 Pages
Unlock Document

Ryerson University
Information Technology Management
ITM 200
Vikraman Baskaran

Chapter 5 The if-else statement 5.1 An exam-mark recording problem If some students have been given their marks for an exam (out of 100) and need to know whether they have passed (scored 40 or more) You would have to write the following pseudoccode first o 1. Get the mark from the student o 2. IF it is greater than the pass mark, tell them they have passed ELSE tell them they have failed o 3. Thank them for using the system 5.2 Boolean expressions A Boolean expression is one which evaluates to a Boolean value There are only 2 possible values for Boolean expressions: true and false Simple Boolean expressions from the relational operations are o < less than (5<6) o > greater than (m>n) o <= less than or equal (5<=(a+1)) o >= greater than or equal (a >= 7) o == equals (a+1) == (b+1) o != not equals (5 != 6) Operator precedence Precedence (priority) determines the order in which operations are evaluated For example, 2+3*4 o You evaluate 3*4 first then add 2 You do this because * has a higher precedence than +
More Less

Related notes for ITM 200

Log In


Don't have an account?

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.