Presentation is loading. Please wait.

Presentation is loading. Please wait.

Review Materials I (T) Subject : T0016 – ALGORITHM AND PROGRAMMING

Similar presentations


Presentation on theme: "Review Materials I (T) Subject : T0016 – ALGORITHM AND PROGRAMMING"— Presentation transcript:

1

2 Review Materials I (T) Subject : T0016 – ALGORITHM AND PROGRAMMING
Year : 2013 Review Materials I (T)

3 T0016 - Algorithm and Programming
Review Materials Algorithm & Programming Introduction to C Programming I Introduction to C Programming II Operator, Operand, and Arithmetic Program Control: Selection Program Control: Repetition Pointers and Arrays T Algorithm and Programming

4 T0016 - Algorithm and Programming
Exercise Create Pseudocode and Flowchart for the following problem : A shopping market is in need of a program to support cashier. The program will first read the product code from screen, validate that product code should be 10 digits of characters. Other than that, quantity and price will be asked for each of products. Program will also need to validate if quantity and price is all numbers with minimum value of 1. All these process will be repeated for every products shopped by customer. Program will stop computing and display the amount that should be paid by customer when user input product code with T Algorithm and Programming

5 T0016 - Algorithm and Programming
Exercise 2. Decide if the following statements are TRUE or FALSE a) Variable name can be started with numbers, ex : 1name b) Variable name can not consist of more than a word c) We can make variable with name of : system 3. Do the following syntax : scanf(“%s”, temp) and gets(temp) have the same function? What is the output if the input is : “Good Morning” ? T Algorithm and Programming

6 T0016 - Algorithm and Programming
Exercise 4. If all variables are integer, then state the value of A if: B=13; C=11; D=42; E=0; A = B && E; A = B & C; A = C || D; A = B | D; A = B > 2; A = B >> 2; A = C < 3; A = C << 3; A = B = C; A = B == C; T Algorithm and Programming

7 T0016 - Algorithm and Programming
Exercise 5. Given the following decimal : 15870, convert it to : a) Binary b) Octal c) Hexadecimal 6. What is the result of z = (x ==1) ? 5 : 7 if x is 0 ? 7. Are these two block of codes the same? If mark is 90, what is the output of grade from (a) and (b)? if(mark>=85) grade = 'A'; if(mark>=75) grade = 'B'; (a) if(mark>=85) grade = 'A' else if(mark>=75) grade = 'B‘ (b) T Algorithm and Programming

8 T0016 - Algorithm and Programming
Exercise 8. What is Nested if? 9. What is the main difference between do-while statements and while statements in C? 10. Create the following program : N = How do we validate length of a string is no more than 30 and not less than 5? T Algorithm and Programming

9 T0016 - Algorithm and Programming
Exercise 12. Create a program to convert all first letters of every word to be uppercase, while the rest is remain unchanged Example : happy Birthday  Happy Birthday Good MorNinG  Good MorNinG good night  Good Night T Algorithm and Programming

10 T0016 - Algorithm and Programming
Exercise 13. Create a program to check if a word is palindrome! example : exe, madam, mam, mom, dad 14. Create a program to do multiplication of these two matrices, using array 2D! T Algorithm and Programming

11 T0016 - Algorithm and Programming
END T Algorithm and Programming


Download ppt "Review Materials I (T) Subject : T0016 – ALGORITHM AND PROGRAMMING"

Similar presentations


Ads by Google