Introduction To Programming Information Technology , 1’st Semester MINISTRY OF EDUCATION & HIGHER EDUCATION COLLEGE OF SCIENCE AND TECHNOLOGY KHANYOUNIS- PALESTINE Using Java Introduction To Programming Information Technology , 1’st Semester Lecture 8 Decision Making Practices Teacher: Mahmoud Rafeek Alfarra
Practice 1 Identify and correct the errors in each of the following sets of code: if ( gender == 1 ) System.out.println( "Woman" ); else; System.out.println( "Man" ); while ( z >= 0 ) sum += z; Presented & Prepared by: Mahmoud R. Alfarra
Practice 1 Identify and correct the errors in each of the following sets of code: if ( age >= 65 ); System.out.println( "Age greater than or equal to 65" ); else System.out.println( "Age is less than 65 )"; int x = 1, total; while ( x <= 10 ){ total += x; ++x; } Presented & Prepared by: Mahmoud R. Alfarra
Practice 1 Identify and correct the errors in each of the following sets of code: while ( x <= 100 ) total += x; ++x; while ( y > 0 ) { System.out.println( y ); ++y; } Presented & Prepared by: Mahmoud R. Alfarra
Practice 2 Trace the following program, assuming x =5, y = 8 and x=8, y=5: Presented & Prepared by: Mahmoud R. Alfarra
Practice 2 Determine the output for each of the given sets of code when x is 9 and y is 11 and when x is 11 and y is 9. Presented & Prepared by: Mahmoud R. Alfarra
Practice 2 Determine the output for each of the given sets of code when x is 9 and y is 11 and when x is 11 and y is 9. Presented & Prepared by: Mahmoud R. Alfarra
(سَبِّـحِ اسم رَبِّكَـ الأَعْـلَـى) Emank X Mezank يقول رب العزة (سبحانـه) (سَبِّـحِ اسم رَبِّكَـ الأَعْـلَـى) Presented & Prepared by: Mahmoud R. Alfarra
Next… Practices Presented & Prepared by: Mahmoud R. Alfarra