Write a function findFirstPlace that receives a ID array of 3 strings representing marathon contestant names, a ID array
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Write a function findFirstPlace that receives a ID array of 3 strings representing marathon contestant names, a ID array
#include «string> and namespace std;
Write a function findFirstPlace that receives a ID array of 3 strings representing marathon contestant names, a ID array of 3 integers representing the marathon finish time (in minutes), and an integer representing the size of the arrays. void printFirstPlace (string names[], int minutes [], int size) The function should print the information of the contestant who came in first place (i.e., the contestant with the least time). In the main function, ask the user to input the name and time in minutes for each contestant, then call the function using these data. Sample outputs (user input is indicated as bold): Please enter contestant name: Ali Please enter the time (in minutes): 14 Please enter contestant name: Abdulrahman Please enter the time (in minutes): 13 Please enter contestant name: Mohamed Please enter the time in minutes): 15 The contestant in first place is Abdulrahman with 13 minutes.