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

  1. Data structures:
    1. Define a WinLoss structure with wins and losses members (int).
    2. 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.
    3. Declare an array of type Team.
  2. Build a menu-driven program with these options:
    1. Enter a new team
    2. Display all teams
    3. Display a particular team
    4. Exit the program
  3. Define these functions according to these prototypes:
    1. int menu(); Shows the menu Gets the user selection Validates the menu selection Returns a valid menu selection
    2. 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.
    3. void displayWinLoss(WinLoss); Displays a string containing the win and loss members in the format of "wins-losses".
    4. 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
    5. 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
    6. 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.
  4. Functions must pass parameters and return values as needed, using only local variables. Global variables are not allowed.
  5. Create any other functions or variables as you see fit.

C++ Language, Need help on this assignment CIS 1202 Programming Assignment #6

- 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!