int calculateAge(int current_year, int birth_year) { part b) The teacher wants to determine if a group of students is eligible for this competition. Complete the following piece of code considering that the age of these students are stored in the studentsAge array and use the calculateAge function to determine the eligibility. Note: solution should use calculateAge !
in C++ program please:
part a)
According to Wikipedia: “The International Collegiate
Complete the following function which takes as input two parameters: the current year and the birth year of a student. The function should return the age of the person given the parameters.
int calculateAge(int current_year, int birth_year) {
part b)
The teacher wants to determine if a group of students is eligible for this competition. Complete the following piece of code considering that the age of these students are stored in the studentsAge array and use the calculateAge function to determine the eligibility.
Note: solution should use calculateAge !
int main() { int studentsAge[10];
#your answer
for (int i = 0; i < 10; i++) { cin >> studentsAge[i];
# your answer
Your program should print “The students are eligible” or “The students are not eligible” once it is run.
Step by step
Solved in 2 steps with 1 images