Httpwwwcscityueduhkhelena 4 program structure iii

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: d nice Sim a le rt('C o ng ra d ula tio ns !...') ; A bit complicated erred) (Not pref (CS1301) Introduction to Computer Programming City Univ of HK / Dept of CS / Helena Wong - changes the value of the left-hand-side object (according to right-hand-side) - it does not compare any value. http://www.cs.cityu.edu.hk/~helena 4. Program Structure III - 13 Data Types Decision Making: Logical Operators To perform Boolean algebra. Logical AND : && Logical OR : || Logical NOT : ! if ( (e ng lis h _m a rk >= 8 1 ) && (c h ine s e _m a rk >= 8 1 ) && (m a th s _m a rk >= 8 1 ) ) a le rt('We ll d o ne ! All d is tinc tio ns !') ; * Try adding it to the "MARKS TO GRADES CONVERSION" example (replace e ng lis h _m a rk with d o c um e nt.F1 .EMa rk.va lue etc..) Checking of Equilateral Triangle: s id e 1 s id e 3 s id e 2 if ( s id e 1 == s id e 2 && s id e 2 ==s id e 3 ) a le rt('Eq uila te ra l tria ng le ') ; Don't write if (s id e 1 == s id e 2 == s id e 3 ) (CS1301) Introduction to Computer Programming City Univ of HK...
View Full Document

This note was uploaded on 03/10/2012 for the course CS 1301 taught by Professor Dr.wong during the Winter '08 term at City University of Hong Kong.

Ask a homework question - tutors are online