Question: C++ Language, Need help on this assignment CIS 1202 Programming Assignment #6 Structured Data 1 A sports team plays games at home and away. Write
C++ Language, Need help on this assignment
CIS 1202 Programming Assignment #6
Structured Data 1
A sports team plays games at home and away. Write a program to keep track of a team's win/loss record at home, away, and their total. Use nested structures as you develop this program.
Requirements
- Data structures:
- Define a WinLoss structure with wins and losses members (int).
- Define a Team structure with the team name, containing a WinLoss structure variable for total wins/losses, a WinLoss structure variable for home wins/losses, and a WinLoss structure variable for away wins/losses.
- Declare an array of type Team.
- Build a menu-driven program with these options:
- Enter a new team
- Display all teams
- Display a particular team
- Exit the program
- Define these functions according to these prototypes:
- int menu(); Shows the menu Gets the user selection Validates the menu selection Returns a valid menu selection
- WinLoss getWinLoss(string); Gets wins and losses from the keyboard for the location indicated by the string parameter ("home" or "away") and returns a WinLoss structure containing the input.
- void displayWinLoss(WinLoss); Displays a string containing the win and loss members in the format of "wins-losses".
- Team getTeam(); Inputs the team name Inputs home wins and losses using getWinLoss() Inputs away wins and losses using getWinLoss() Stores the home wins/losses in the appropriate team structure Stores the away wins/losses in the appropriate team structure Calculates the total wins/losses and stores those in the appropriate structure Returns all of this in a single Team structure
- void displayTeam(Team); Displays the team name, total wins and losses, home wins and losses, and away wins and losses. Use the displayWinLoss function described abov
- void findTeam(Team[], int); Prompt the user for the team name Search the array for a match If there is a match, display the team information using the displayTeam function described above. If there is no match, display an error message.
- Functions must pass parameters and return values as needed, using only local variables. Global variables are not allowed.
- Create any other functions or variables as you see fit.

- cs. Command Prompt - "7 Structures.exe" 1. Enter a new team 2. Display all teams 3. Display a particular team 4. Exit the program 1 Team name? Cincinnati Reds Enter the home wins: 1 Enter the home losses: 3 Enter the away wins: 4 Enter the away losses: 56 1. Enter a new team 2. Display all teams 3. Display a particular team 4. Exit the program 1 Team name? Dayton Dragons Enter the home wins: 3 Enter the home losses: 5 Enter the away wins: 11 Enter the away losses: 3 1. Enter a new team 2. Display all teams 3. Display a particular team 4. Exit the program 2 Cincinnati Reds Total record 5-59 Home record 1-3 Away record 4-56 Dayton Dragons Total record 14-8 Home record 3-5 Away record 11-3 1. Enter a new team 2. Display all teams 3. Display a particular team 4. Exit the program 3 Team name? Cincinnati Reds Cincinnati Reds Total record 5-59 Home record 1-3 Away record 4-56 1. Enter a new team 2. Display all teams 3. Display a particular team 4. Exit the program 3 Team name? Chicago Glurbs Team not found
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
