Guest User

Untitled

a guest
Dec 12th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. void inputDataOnce(struct footballTeam team) {
  2. cout << "Enter team's name: ";
  3. cin >> team.name;
  4.  
  5. cout << "nEnter team's done goals: ";
  6. cin >> team.doneGoals;
  7.  
  8. cout << "nEnter team's taken goals: ";
  9. cin >> team.takenGoals;
  10.  
  11. cout << "nEnter team's points: ";
  12. cin >> team.score; }
  13.  
  14. void inputData(struct footballTeam arr[], const int size) {
  15. for (int i = 0; i < size; i++) {
  16. inputDataOnce(arr[i]);
  17. }
  18.  
  19. void outputData(struct footballTeam team) {
  20. cout << team.name;
  21. cout << team.doneGoals;
  22. cout << team.takenGoals;
  23. cout << team.score;
  24. }
  25.  
  26. void nameReference(struct footballTeam arr[], const int size) {
  27. char name[50];
  28.  
  29. cout << "Enter a football team name to do a reference.n";
  30. cin >> name;
  31.  
  32. for (int i = 0; i < size; i++) {
  33. if (name == arr[i].name) {
  34. outputData(arr[i]);
  35. }
  36. }
Add Comment
Please, Sign In to add comment