In C++ please, using basic programming one coding   The main menu should show the available options: Show the roster: Displays all the player names and jersey numbers in a numbered list. Ex: 1. Susan Martinez (33), 2. Jake Smith (21), etc. Add a player: Prompts the user to type the player's full name and jersey number. Then adds the player to the roster. Remove a player: Displays the roster and prompts the user to enter the number of the player to remove. Then removes the player from the roster. Quit: Quits the program. The program should display the main menu after the user shows the roster, adds a player, or removes a player. The program only terminates when the user chooses the quit option. Data validation should be used where appropriate. Ex: The user should not be able to choose an option that doesn't exist or delete a player that doesn't exist. The roster should be kept in alphabetic order by the players' full names. Ex: If Alice Chang (9) is added to a roster with Jake Smith and Susan Martinez, Alice would become the first person in the roster since "A" comes before "J" in Jake. If Zack Nugen is then added, Zack would be the last person in the roster because "Z" comes after "S" in Susan. When the program first starts, the roster should be randomly generated: The number of players should be randomly selected between 5 and 10. The first and last names of each player should be randomly generated from a list of at least 20 possible first names and 20 possible last names. The jersey number should be randomly assigned a number between 1 and 99. It's possible to have two randomly generated players with the same names and numbers, so don't worry about enforcing uniqueness. C++ program requirements: Two parallel vectors declared in main() must be used to store the player names and jersey numbers. Use functions where appropriate that are named well with each serving a single purpose. Seed the random number generator appropriately, and use rand() to randomly generate the initial roster. Create two vectors of possible first names and last names to help generate the random player names. Use the vector.erase() function to remove a player from the player names and jersey number vectors. (Do some online searching to discover how vector.erase() works, and cite the URL in a C++ comment above the call to vector.erase() where you find the information.) Use a sorting algorithm to keep the parallel vectors in ascending order by player name. In addition to storing player names and jersey numbers, create a third vector that stores the player's position. The position should be created using an enumerated type. Ex: vector playerPositions where Position is the enum. Include the position as part of the roster output. Create a unit test that adequately tests one of your functions. Functions that produce output, receive input, or produce random numbers are not good functions to test. Functions that return a value or change a reference parameter are good functions to test. Your unit test with assert() calls should be in a function called UnitTest().

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter7: String Manipulation
Section: Chapter Questions
Problem 6E
icon
Related questions
Question

In C++ please, using basic programming one coding

 

The main menu should show the available options:

Show the roster: Displays all the player names and jersey numbers in a numbered list. Ex: 1. Susan Martinez (33), 2. Jake Smith (21), etc.

Add a player: Prompts the user to type the player's full name and jersey number. Then adds the player to the roster.

Remove a player: Displays the roster and prompts the user to enter the number of the player to remove. Then removes the player from the roster.

Quit: Quits the program.

The program should display the main menu after the user shows the roster, adds a player, or removes a player. The program only terminates when the user chooses the quit option.

Data validation should be used where appropriate. Ex: The user should not be able to choose an option that doesn't exist or delete a player that doesn't exist.

The roster should be kept in alphabetic order by the players' full names. Ex: If Alice Chang (9) is added to a roster with Jake Smith and Susan Martinez, Alice would become the first person in the roster since "A" comes before "J" in Jake. If Zack Nugen is then added, Zack would be the last person in the roster because "Z" comes after "S" in Susan.

When the program first starts, the roster should be randomly generated:

The number of players should be randomly selected between 5 and 10.

The first and last names of each player should be randomly generated from a list of at least 20 possible first names and 20 possible last names.

The jersey number should be randomly assigned a number between 1 and 99.

It's possible to have two randomly generated players with the same names and numbers, so don't worry about enforcing uniqueness.

C++ program requirements:

Two parallel vectors declared in main() must be used to store the player names and jersey numbers.

Use functions where appropriate that are named well with each serving a single purpose.

Seed the random number generator appropriately, and use rand() to randomly generate the initial roster.

Create two vectors of possible first names and last names to help generate the random player names.

Use the vector.erase() function to remove a player from the player names and jersey number vectors. (Do some online searching to discover how vector.erase() works, and cite the URL in a C++ comment above the call to vector.erase() where you find the information.)

Use a sorting algorithm to keep the parallel vectors in ascending order by player name.

In addition to storing player names and jersey numbers, create a third vector that stores the player's position. The position should be created using an enumerated type. Ex: vector<Position> playerPositions where Position is the enum. Include the position as part of the roster output.

Create a unit test that adequately tests one of your functions. Functions that produce output, receive input, or produce random numbers are not good functions to test. Functions that return a value or change a reference parameter are good functions to test. Your unit test with assert() calls should be in a function called UnitTest().

 

 

What are "qns"
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Linux
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT