Cosc102 Exam 17 - 18
Cosc102 Exam 17 - 18
(a) Declare and initialize a two dimensional chmcter array named magicS to hold the -:ach
character illustrated above.
(b) Write a nested for ... loop to display the elements in the array.
3.
a. You are to develop a generic program that all subject teachers in Senior Secondary School
of Ba!,cock High School can use. The problem is that the teachers do not know the number
of sMlents offering their subjects in advance. Therefore, you are to use while .. loop with
sentinel value to take in the scores of the students.
b. Develop an application that computes both the force applied to an object and area of a
square. Hint: Forre=m X g (where m=mass of an object. g;acceleration due to gravity),
Area of squar~length X length. Hint: g is a constant and use define macro function for
computing square
4. Nigerian Government has contacted you to develop a real time voting system for the coming
2019 presidential election. The presidential candidates are:
(i) Ademola ~yo (ii) Makinde Kayode (iii) Olajire Adegoke (iv) Olufemi Bamiro
With the use of switch case, develop a C++ application that
a. Allow a voter to vote for candidate of choice
b. Produce vote count for each candidate
c. \\'ill continue to run until there is no more voter.
SECTION C: Alternative to Practical (Attempt all)
I. Consider the following code extract and correct the errors
[~
if(creditcard= I)
{
\ cout<<"You can call, send sms and browse, ENJOY "<<end);
} else
cout<<"Buy a credit call card"<<endl;