Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

C + + BASEBALL LINEUP PROJECT Page 1 of 2 Create a baseball lineup for a PONY baseball team User Requirements A manager of a

C++ BASEBALL LINEUP PROJECT
Page 1 of 2
Create a baseball lineup for a PONY baseball team
User Requirements
A manager of a PONY (Protect Our Nations Youth) baseball team has hired you to design a program that creates a
baseball lineup and position assignment. The lineup (i.e., the batting order from 1st to last) will be based on the batting
average of each player. For example, if Joshua has an average of 692 and Jackson has an average of 459, Joshua will be
placed first in the lineup, followed by Jackson.
In terms of the position assignment (i.e., Joshua plays 1st base in inning 1,3rd base in inning 2, center field in inning 3,
etc.) your program must assign the field positions for each defensive player in accordance to the PONY Shetland rules
stated below.
1. The line-up should include batting order and players defensive positions for each of the five innings.
2. Each team shall play all players in the field in defensive positions. Additional players, (short fielders), shall be
positioned in the outfield no closer than 20 feet to the baseline when the ball is hit and will be considered
outfielders.
3. Each player must be scheduled to play an infield position at least one (1) inning. Catcher will be considered an
infield position. A player may only be scheduled to play catcher a maximum of one (1) inning per game. No
player may play a second inning of infield until every other player has played one inning of infield.
4. A player cannot play the same defensive position for more than one (1) inning per game.
5. A player can only sit out one (1) inning per game.
Enter 12 player names:
What is player 1s name: Jackson
What is player 2s name: Ben
What is player 3s name: Harper
What is player 4s name: Mason
What is player 5s name: Sean
What is player 6s name: Robert
What is player 7s name: Hayden
What is player 8s name: James
What is player 9s name: Luke
What is player 10s name: Ryan
What is player 11s name: Grant
What is player 12s name: Joshua
C++ BASEBALL LINEUP PROJECT
Page 2 of 2
Enter the averages for each player:
-----------------------------------
What is Jacksons average: 399
What is Bens average: 616
What is Harpers average: 511
What is Masons average: 647
What is Seans average: 401
What is Roberts average: 545
What is Haydens average: 533
What is Jamess average: 632
What is Lukes average: 499
What is Ryans average: 470
What is Grants average: 578
What is Joshuas average: 777
Game lineup and field positions:
--------------------------------
Name Inning 1 Inning 2 Inning 3 Inning 4 Inning 5
Joshua RF 2B RCF OUT P
Mason RCF 3B LCF 1B OUT
James 2B RF OUT C LF
Ben 1B RCF P OUT SS
Grant P OUT 1B LCF RF
Robert LCF 1B OUT 2B RCF
Hayden LF SS RF 3B C
Harper C LCF SS RF 2B
Luke SS LF 3B P OUT
Ryan OUT C LF RCF 3B
Sean 3B OUT 2B LF 1B
Jackson OUT P C SS LCF
Software Requirements
- Create a flowchart or pseudo code to establish an algorithm of how to solve this problem.
- Use a two dimensional string array to store the lineup player names and position assignments for each player as seen
above.
- You can use an iterative approach to display the array, but if you are going to use a recursive approach, use a recursive
function to display the names and positions of the lineup and field positions. This recursive function must be a void
function called displayArray that receives a 2D array, a first index whole number, and a last index whole number. The
void function must use the divide-and-conquer approach as described in your text.
- You are permitted to create any additional arrays, variables, functions, etc. towards the completion of this project.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions