COMPUTER PROGRAMMING 1 (CSC201) PAST QUESTIONS - FUO 2018/2019 SESSION

 

CSC201: COMPUTER PROGRAMMING 1 (Federal University Otuoke 1ST SEMESTER EXAMINATION 2017/2018 session)

Instruction: answer 4 questions; all in section A and any 2 in section B.

SECTION A: COMPULSORY

1.     QUESTION ONE

a.     Explain the significance of compilers in program development. What changes to compilations did you observe during your practical session(s)?

b.     Given that PV =nRT; P = Pressure (atm), V = Volume (Litres-L), n = Number of moles (mol), R = The Ideal Gas Constant (0.08206 L-atm/mol-K), T = Temperature (Kelvin).  Evolve codes to compute five different values of P, for five different values of other independent variables.

2.     QUESTION TWO

a.     Computer programs solve similar occurrences of a particular problem. Explain.

b.     By Newton’s second law, the lit force balance L, for the centripetal acceleration, in the lateral direction for Airplanes, is given by  LsinƟ = mV2/R where Ɵ is the bank angle, m is the mass of the plane, V is the velocity of plane with respect to the ground, and R is the radius of the turn and is given by R = V2 / gTanƟ. Write a C++ program to compile the lift force, L. Note: sinƟ is written sin(Ɵ), where Ɵ is the angle value.

SECTION B

3.     QUESTION THREE

a.     Classes are considered to be extended types, discuss with illustration.

b.     Develop a flowchart that displays the logical steps to identifying a prime number. Transform the flowchart into a suitable C++ program.

4.      QUESTION FOUR

a.     Consider the odd series, 1, 3, 5 . . . 97. Write a function to generate this series up to the last term. Hence print the sum and average of the series.

b.     explain functions of the following:

                                                              i.      #include <iostream>

                                                            ii.      Cmath

                                                          iii.      Using namespace std

                                                         iv.      Continue

                                                           v.      Break

5.     QUESTION FIVE

a.      Give reasons for the following statements:

                                                              i.      Header files very necessary in the program development

                                                            ii.      Void and typed functions are very necessary in program development

                                                          iii.      IDEs necessary for easy and quick program development.

                                                         iv.      Special characters not allowed as part of variable names.

b.     Use a skeletal C++ program to demonstrate the difference between global and local variables. Relate your demonstration to scope and visibility of data.

Comments