lecture_boolean_supplement

lecture_boolean_supplement - CSC1500 Computer Principles...

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

View Full Document Right Arrow Icon
2001-2002 Spring Week 4+ Michael Fung, CS&E, The Chinese University of HK 1 CSC1500 Computer Principles and Programming How to Program a Computer in C and General Introduction to Computing Lecture 4 Supplement
Image of page 1

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

View Full Document Right Arrow Icon
2001-2002 Spring Week 4+ Michael Fung, CS&E, The Chinese University of HK 2 Boolean/Truth/Logic Processing S ( )/ / A proposition may be true, false or undetermined, e.g. true/false questions in examinations You are a boy Peter is 21 years old Principal of no less than HK$30,000 ª ?!
Image of page 2
2001-2002 Spring Week 4+ Michael Fung, CS&E, The Chinese University of HK 3 Boolean Expression How do they look like? For numerics: 3 > 7 –1 != 1 oldWeight >= 190.34 Age = = 18 0.7 * 0.7 = = 0.49 ??? false ??? For characters: ‘Z’ > ‘A’ ‘A’ > ‘0’ ??? true ??? ‘a’ > ‘A’ ??? true ???
Image of page 3

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

View Full Document Right Arrow Icon
2001-2002 Spring Week 4+ Michael Fung, CS&E, The Chinese University of HK 4 Boolean Expression int ° ; /* ° ° ° */ ¤ = ¤ P ± && ° ; --- 8< --------------------------- ° ° ¤ P ± [ ° =false] ° ° ¤ P ± | [ ° =false]
Image of page 4
2001-2002 Spring Week 4+ Michael Fung, CS&E, The Chinese University of HK 5 Boolean AND ( && ) S S S and (&&) true false true true false false false false
Image of page 5

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern