Computers & Programming Languages
Selection – One Way Selection Lesson3- Objectives Use branched flow chart. Use one way selection to solve problems.
Program needs to take decision based on conditions occurrence Branched Flow Chart Program needs to take decision based on conditions occurrence Condition2 Condition3 Condition1
One way selection IF (logical Expression ) الشرط Statement النتيجة
One way selection If (mark>= 90) grade = ‘A’;
Type the program in P-224 and check the results Book Practical Activity P-224 Type the program in P-224 and check the results
Algorithm Book Activity P-225 End Start Input Speed msg True False
Program
Compound Block of Statement When the program execute more statements executed when logical expression evaluates to true we call this “Compound Statement”
Book Activity P-227 This msg is suppose to appear for negative and positive numbers
Class Activity Book Activity P-229 Total Salary = (salary * 0.22) + Salary
Program The msg is written inside the if brackets because I need the msg to appear only if the total salary is > 40
Class Activity Create a java program to get the value of x as per the following equations:
Program