Task 1 Program Code

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

#include <string>

#include <iostream>

using namespace std;

struct Player {

string name;
string nationality;
int caps;
string position;
double fee;

};

int main() {
Player LeicesterCity;
Player England;

cout << "Please type in players full name: ";


getline(cin, LeicesterCity.name);

cout << "Please type in players nationality : ";


getline(cin, LeicesterCity.nationality);

cout << "Please type in number of caps: ";


cin >> LeicesterCity.caps;

cout << "Please type in players playing position: ";


getline(cin, LeicesterCity.position);

cout << "Please type in players fee ";


cin >> LeicesterCity.fee;

cout << "Please type in players position for national team: ";
getline(cin, England.position);

cout << "Please type in number of national caps: ";


cin >> England.caps;

cout << "\nDisplaying Information." << endl;

cout << LeicesterCity.name << endl;


cout << LeicesterCity.nationality << endl;
cout << LeicesterCity.name << "" << "fee is " << LeicesterCity.fee << "and position is " << LeicesterCity.position <<
endl;
cout << LeicesterCity.name << " " << plays in the national squad at << England.position << "and has " <<
England.caps << " number of caps";

return 0;
}

file:///C/...ments/Alternative%20Assessments%20Green/IY53%20Alternative%20Assessment/Task%201%20Program%20Code%20Yellow.txt[23/04/2021 16:36:17]
file:///C/...ments/Alternative%20Assessments%20Green/IY53%20Alternative%20Assessment/Task%201%20Program%20Code%20Yellow.txt[23/04/2021 16:36:17]

You might also like