0% found this document useful (0 votes)
15 views1 page

Gege

test

Uploaded by

Darwyn Rios
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views1 page

Gege

test

Uploaded by

Darwyn Rios
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include <iostream>

#include <string>
using namespace std;
struct athlete
{
string name, sports, team, birthplace, status, ask;
char sex;
int age, years;
double salary;
}
char athlete ath[10];

void main(void)
{
ath info;
for (int i = 0; i < 10; i++)
{
cout << "Enter sports playing: ";
cin >> info[i].sports;
cout << "Enter team name: ";
cin >> info[i].team;
cin.ignore();
cout << "Enter name: ";
getline(cin, info[i].name);
cout << "Is this athlete still playing or retired: ";
cin >> info[i].ask;
cout << "Enter age: ";
cin >> info[i].age;
cin.ignore();
cout << "Enter birthplace: ";
getline(cin, info[i].birthplace);
cout << "Enter sex: ";
cin >> info[i].sex;
cout << "Enter civil status: ";
cin >> info[i].status;
cout << "Enter years playing: ";
cin >> info[i].years;
cout << "Enter money gained while playing: ";
cin >> info[i].salary;
}
cout << "Sports Playing" << "\t" << "Team Name" << "\t" << "Name" << "\t" <<
"Retired/Playing" << "\t" << "Age" << "\t" << "Birthplace" << "\t" << "Sex" << "\t"
<< "Civil Status" << "\t" << "Number of Years Playing" << "\t" << "Money gained" <<
"\t";

for (int i = 0; i < 10; i++)


{
cout << info[i].sports << "\t" << info[i].team << "\t" << info[i].name
<< "\t" << info[i].ask << "t" << info[i].age << "\t" << info[i].birthplace << "\t"
<< info[i].sex << "\t" << info[i].status << "\t" << info[i].years << "\t" <<
info[i].salary << "\t";
}
}

You might also like