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().

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education