Question: Create a C++ program that collects data from the input file and puts it into the array, then displays it. ------------- Racer.txt------- Geraint Thomas, Great
Create a C++ program that collects data from the input file and puts it into the array, then displays it.
------------- Racer.txt-------
Geraint Thomas, Great Britain, 82h 57, 2018
Vincenzo Nibali, Italy, 89h59, 2014
Cadel Evans, Australia, 86h12, 2011
----------------library.h-----------
#include
using namespace std;
struct Racer {
string name;
string country;
unsigned timeInMinute;
unsigned year;
};
bool data(Racer a [], unsigned& n);
void print_data (const Racer a[], unsigned n);
---------------------library.cpp---------------
#include
#include
#include
#include "library.h"
using namespace std;
bool data(Racer a[], unsigned& n) {
}
void print_data(const Racer a[], unsigned n) {
}
--------------------------Main.cpp---------------------
#include
#include
#include
#include "library.h"
using namespace std;
int main() {
const unsigned SIZE = 50;
Racer racers[SIZE];
unsigned num_racers = 0;
//collect data is not ready
if (!data(racers, num_races)) {
cout << "Cant open the file" << endl;
return 1;
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
