Bit 2122:Structured Advanced Programming Question Paper
Bit 2122:Structured Advanced Programming
Course:Bachelor Of Information Technology
Institution: Meru University Of Science And Technology question papers
Exam Year:2014
1 INSTRUCTIONS: Answer question one question and any other two questions
QUESTION ONE – (30 MARKS)
a) With reference to C programming differentiate between: i) Syntax errors and logical errors. (2 marks) ii) Printf and Scanf. (2 marks) iii) Local variable and Global variable (2 marks) iv) Call by value and call by reference (2 marks) b). State three importance of modular design. (3 marks) c) Using if…else control structures write a C program that would be used to grade the following student marks. (5 marks) Score Grade 100-90 A 89-80 B 79-60 C 59-40 D 39-0 E d) C programming language is considered to be a free format and case sensitive language. Describe these two concepts. (4 marks)
2
e) Describe any two ways of stating algorithms. (4 marks) f) Using an example describe how a pointer can be declared and initialized. (3 marks) g) Write a C program to multiply two numbers (3 marks)
QUESTION TWO – (20MARKS) a) i) Define data type. (2 mark) ii) Explain any three data types used in C programming. Give examples of how each is used in variable declaration. (6 marks) b) Explain the program development life cycle (7 marks) C) i) With the aid of a flowchart, illustrate the execution of a while loop. (2 marks) ii) Differentiate between while loop and do while loop as used in C programming. (3 marks)
QUESTION THREE – (20 MARKS) a) Describe four advantages of assembly languages. (4 marks)
b) Using an example, explain how you would do the following:- (6 marks)
i. Insert a comment on a line ii. Insert a comment on multiple lines iii. Display the output on the next line.
c). i) Write a C program to accept two integers, determine the largest among them and displays it on the screen. (5 marks) ii) Draw a flowchart to represent the code above. (5 marks)
3
QUESTION FOUR – (15 MARKS)
a) Using for loop write a C program to output the following. (10 marks) W W W W W W W W W W W W W W W
b) Write a C program to multiply two numbers. (4 marks) c) State three characteristics of a good algorithm (3 marks d) Draw a flowchart to represent the logic of the program in (c) above. (3 marks)
QUESTION FIVE – (20 MARKS)
a. Write a program that accepts an integer and determines whether odd or even then prints out the answer. (6 marks) b. Write a program that accepts an input Radius from the keyboard, calculates the diameter then calculates the area of a circle and display it in a tab. (10 marks) c. Explain any two repetitive structures used in programming. (4 marks)
More Question Papers