BCSE 1102 INTRODUCTION TO PROGRAMMING CAT2 G1 Marking Scheme
BCSE 1102 INTRODUCTION TO PROGRAMMING CAT2 G1 Marking Scheme
CAT 1
INSTRUCTIONS:
Attempt All Questions
4. {
SOLUTION [2 marks]
54 234
c) To qualify to participate at the Freshers Night, you need to meet the following
requirements:
a. Be either 18years old or Female
b. Can afford to pay 500 if alone at the entrance or free if you are accompanied
by a fresher
c. Be a student at CUK
The program should ask the potential participant to fill in this information at the
entrance. Only successful persons will gain entry. Use a single relational
operators’ statement to evaluate eligibility.
Required :
1
Use a function call void eligibility()
This function receives all the information captured from the user and displays
whether the user is eligible or not. [10 marks]
SOLUTION
Important : ELIGIBILITY CRITERIA IS COMPUTED AND DISPLAYED IN THE
FUNCTION CALLED void eligibility() but all the data to be used in the
computation should be captured in the main()
1. #include <stdio.h>
2. void elibility(int YoB, int age, int currentYear,int gender, int rGender,int
bill, int areAccompanied, int accompanied, int areStudent, int student);
3. int main(void)
4. {
5. int YoB=0, age=0, currentYear=2022;
6. int gender=0, rGender=0;
7. int bill=0;
8. int areAccompanied=0,accompanied=0;
9. int areStudent=0, student=0;