0% found this document useful (0 votes)
11 views

Code

The document discusses requirements for players to apply to join a soccer club. It includes requirements like being born after a certain date, having played a minimum number of tournaments, and paying an application fee. The C++ program then collects applicant information, checks if requirements are met, and outputs results to a text file.

Uploaded by

Kelvin Chisanga
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Code

The document discusses requirements for players to apply to join a soccer club. It includes requirements like being born after a certain date, having played a minimum number of tournaments, and paying an application fee. The C++ program then collects applicant information, checks if requirements are met, and outputs results to a text file.

Uploaded by

Kelvin Chisanga
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

/*

The assumptions that we made here is that the club need to manage recruitment process of its players

Therefore potential players must apply to the club

The applicant must have reached a certain age group to qualify say 15 years.

they must be born before June 2005

The applicant must have played a minimum number of tournaments from the previous club

The applicant must pay an application fee of $250, if the applicant does partial payment,

then the system must show the outstanding balance

*/

#include<iostream>

#include<string>

#include<fstream>

using namespace std;

int main ()

string surname,name,next_of_kin,address,previous_club;

double amount,day,month,year,number_of_tournaments;

int i;

ofstream Five_aside("soccer.txt"); // initiate an output file to write the information

if (Five_aside.is_open())

for(i=1;i<=3;i++)
{cout<<"enter surname "<<endl;

cin>>surname;

cout<<"enter name "<<endl;

cin>>name;

cout<<"enter date of birth in the form; day: month: year"<<endl;

cout<<"day\n";

cin>>day;

cout<<"month\n";

cin>>month;

cout<<"year\n";

cin>>year;

cout<<"enter gurdian name "<<endl;

cin>>next_of_kin;

cout<<"enter address "<<endl;

cin>>address;

cout<<"enter previous club "<<endl;

cin>>previous_club;

cout<<"enter number of tournaments played "<<endl;

cin>>number_of_tournaments;

cout<<"enter amount paid "<<endl;

cin>>amount;

Five_aside<<surname<<"\n"<<name<<"\n"<<day<<"-"<<month<<"-"<<year<<"\n"<<
next_of_kin<<"\n"<<address<<"\n"<<previous_club<<"\n"<<number_of_tournaments<<"\n"<<amount<
<"\n\n";
if ((month>6)&&(year)>=2005)

if(amount>=40)

if(number_of_tournaments<5)

Five_aside<<" you can qualify to join the team \n";

Five_aside<<" your outstanding balance is:"<<50-amount<<endl;

else Five_aside<<" number of tournaments are below minimum to qualify \n";

else Five_aside<<" your amount is insuficient to register\n";

else Five_aside<<name<<" "<<"is below minimum age to qualify \n";

cout<<"_______________________________________________________________________________
__________________________\n";

Five_aside.close();

else{ cout<<" unable to open\n";}

string club;
ifstream display("soccer.txt");

if(display.is_open())

while (getline(display, club))

cout<<club<<"\n\n";

display.close();

else cout<<"unable to open file";

You might also like