Skip to main content

Posts

Lab Session 9 ( 10 December 2018)

QUESTION 1 : QUESTION 2 :
Recent posts

Lab Session 8 ( 26 November 2018)

Question 1(a) Question 1(b) Question 2 Question 3

Lab Session 7 ( 19 November 2018)

QUESTION A.) Create a program to generate a multiplication table by using while loop. The multiply is determined base on user input. QUESTION B.) Calculate the total of any five number using do... while loop. QUESTION C.) Write a program for the following problem by using for statement: Ahmad saves RM1000 in his account in a bank which returns 5% of annual interest. Assuming that all interests is left deposited in his account, calculate and print the amount of money in his account at the end of each year for 10 years by using for loop.

Lab Session 6 ( 12 November 2018)

QUESTION 1 (A) QUESTION 1 (B) QUESTION 1 (C)

Lab Session 5 ( 29 October 2018)

LAB ACTIVITY (5) a.        i. y = (m*x) + c ii. ( (2*a) / b ) * (3*c) iii. ( (9*p) + (2*q*(r + 2) ) ) / (2 * (s – 1) ) iv. ( ( (3*e) – d) / (x – 9) ) – (4 – (3*pow(c,3) ) / (4*y) ) b.       i. ( (6/2) * 3) + 7 – 1 = 15 ii. (2 % 2) + (2*2) – (2/2) = 3 iii. ( (3/3) * 9 ) * 3 * 3 = 81 iv. ( ( (4*3) / (12/2) ) + 3) – (4*1) = 1 c.        i. 24 ii. 27 iii. 25 iv. 29 d.       i. 4 ii. 5 iii. 16 iv. 8 v. 3 vi. 5 e.       Output: 1: 10 2: 10 3: 11 4: 12 5: 12 6: 31 7: -11 8: 33 9: 33 10: 33 11: 0 12: 1 13: 0 f.         i. printf(“\n%d”, i+j); ii. printf(“\n%d”, ++i + j); iii. printf(“\n%d”, (++i) + (++j) ); iv. printf(“\n%d”, (2*j) + i); v. printf(“\n%d”, (6*j) + (3*i) );

Lab Session 4 ( 8 October 2018)

LAB ACTIVITY 4 QUESTION 1a.) a.)Built the program that display output below. RESULT QUESTION 1b) RESULT

Lab Session 3 ( 1 October 2018)

LAB ACTIVITY 3 QUESTION 1  a. )  ANSWER b. ) ANSWER  c.) ANSWER   QUESTION 2 2.1 Print a message to ask user to enter their name. 2.2 Read name. 2.3 Print a message to ask user to enter their height and weight in kg and m. 2.4 Read weight and height. 2.5 Print name. 2.6 Print weight and height. QUESTION 3 3.1 Declare identifier of integer data type named num1. 3.2 Declare identifier of float data type named num2. 3.3 Declare a constant called MAX with a value of 50.88. 3.4 Print a message to ask user to enter value for num1. 3.5 Read num1. 3.6 Print a message to ask user to enter value for num2. 3.7 Read num2. 3.8 Print a message to ask user to enter value for MAX. 3.9 Read MAX. 3.10 Print num1, num2 and MAX. ANSWER QUESTION 4 Develop a simple subject registration system. The program requires user to enter student's full name, I/C number, matric number, s...