= 0 ) sum += z; Presented & Prepared by: Mahmoud R. Alfarra"> = 0 ) sum += z; Presented & Prepared by: Mahmoud R. Alfarra">

Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction To Programming Information Technology , 1’st Semester

Similar presentations


Presentation on theme: "Introduction To Programming Information Technology , 1’st Semester"— Presentation transcript:

1 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

2 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

3 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

4 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

5 Practice 2 Trace the following program, assuming x =5, y = 8 and x=8, y=5: Presented & Prepared by: Mahmoud R. Alfarra

6 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

7 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

8 (‏سَبِّـحِ اسم رَبِّكَـ الأَعْـلَـى)
Emank X Mezank ‏يقول رب العزة (سبحانـه) (‏سَبِّـحِ اسم رَبِّكَـ الأَعْـلَـى) Presented & Prepared by: Mahmoud R. Alfarra

9 Next… Practices Presented & Prepared by: Mahmoud R. Alfarra


Download ppt "Introduction To Programming Information Technology , 1’st Semester"

Similar presentations


Ads by Google