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 !

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter9: Completing The Basics
Section: Chapter Questions
Problem 9PP
icon
Related questions
Question

in C++ program please:

part a) 

According to Wikipedia: “The International Collegiate Programming Contest, known as the ICPC, is an annual multi-tiered competitive programming competition among the universities of the world.” Moreover, the participants of the contest should be no older than 24.

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.

Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning