Get premium membership and access revision papers, questions with answers as well as video lessons.

Ics2108:Programming Question Paper

Ics2108:Programming 

Course:Bachelor Of Supplies Management

Institution: Meru University Of Science And Technology question papers

Exam Year:2013



QUESTION ONE - (30 MARKS)
a) Explain each of the following terms as used in Java; i. Class (3 Marks) ii. Method (3 Marks) b) Explain what a Java package is in the Java Programming Language c) Explain how to initialize an array. (4 Marks) d) Explain the DO…WHILE loop with the help of an example. (4 Marks) e) i) Write a statement that assigns the value 250 to the 12th element in an array. ( 2 Marks) ii) Write a statement that initializes an array with the following values at the time of the array’s creation 2,4,6,8,10,12,14,16,18,20 iii) Use the length property to find the number of elements in the array. (3 Marks) f) Contrast the Switch and If statements in Java. (4 Marks)
QUESTION TWO (20 MARKS)
a) Discuss three applications of Stacks and Queues. (6 Marks) b) Discuss the following types of arrays, showing how each of them is declared. i. Array (4 Marks) ii. Two – dimensional array (3 Marks) iii. Multi – dimensional array. (3 Marks) c) Distinguish the following Java types of Programs. i. Application (2 Marks) ii. Applets (2 Marks)
2
QUESTION THREE (20 MARKS)
a) Illustrate the Nested If Statements in relation branching in Java. ( 5 Marks) b) Write a program in Java that displays the following sentence; “welcome to MUCST”. (4 Marks) c) Explain the eight primitive types provided in Java; (3 Marks) d) Explain the following swing component in Java; Frames (2 Marks) e) Explain the following concepts in Java i. Objects (2 Marks) ii. Classes (2 Marks) iii. Strings (2 Marks)
QUESTION FOUR (20 MARKS)
a) Explain different ways of traversing a binary tree. (10 Marks) b) Distinguish between the methods System.out.print1n( ) and System.out.print( ) with the help of a code snippet. (4 Marks) c) Explain the following terms in relation to linked lists: i. Insert (2 Marks) ii. Remove (2 Marks) d) Distinguish between the stack and queue data structures. (2 Marks)
QUESTION FIVE (20 MARKS)
a) Write a program that computes the volume of an object. The program should ask the user to input the object mass and density. The mass will be given is grams; the density will be in grams per cubic centimeter. (10 Marks) Hint: the relationship of mass, density and volume of a variable is given by Volume = mass/density b) Write a program that calculates the net salary of an employee whose details are shown below. (10 Marks) Basic pay: 50,000.00 Allowances 1. Housing: 60,000.00 2. Commuting:10,000.00 3. Medical: 20,000.00
Loan/Coop shares/Welfare
1. Bank loan:20,000.00
3
2. Shares: 10,000.00 3. Welfare: 500.00 Tax: PAYE: 30% of Gross pay






More Question Papers


Popular Exams



Return to Question Papers