Lab Instructor: Salem Othman Branching Lab 2 Lab Instructor: Salem Othman
Review Go to Dr. Mikhail Nesterenko website and read the topic: Boolean algebra, Boolean and relational operators, branching constructs You need to understand: if-statement if if-else if-else-if switch-statement
Question 1
Question 2 Block
Question 3
Mini sort ? one ? two ? three
Mini sort 3 one 2 two 1 three
Mini sort ? tmp 3 one 3 tmp 2 two 1 three 3 two 3 tmp 1 three 2 one 2
Number spell first digit second digit 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 …………..99 if(number of tens is equal to 1) switch that recognizes the second digit and prints the whole number "ten", "eleven", or ... else switch that recognizes the first digit and prints "twenty" or "thirty", or ... note that this switch should ignore the case (print nothing) if the first digit is zero after that switch that recognizes the second digit and prints "one" or "two", or ... note that this switch should also ignore the case of zero