Answered step by step
Verified Expert Solution
Question
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 of
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 ie the batting order from st to last will be based on the batting
average of each player. For example, if Joshua has an average of and Jackson has an average of Joshua will be
placed first in the lineup, followed by Jackson.
In terms of the position assignment ie Joshua plays st base in inning rd base in inning center field in inning
etc. your program must assign the field positions for each defensive player in accordance to the PONY Shetland rules
stated below.
The lineup should include batting order and players defensive positions for each of the five innings.
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 feet to the baseline when the ball is hit and will be considered
outfielders.
Each player must be scheduled to play an infield position at least one inning. Catcher will be considered an
infield position. A player may only be scheduled to play catcher a maximum of one inning per game. No
player may play a second inning of infield until every other player has played one inning of infield.
A player cannot play the same defensive position for more than one inning per game.
A player can only sit out one inning per game.
Enter player names:
What is player s name: Jackson
What is player s name: Ben
What is player s name: Harper
What is player s name: Mason
What is player s name: Sean
What is player s name: Robert
What is player s name: Hayden
What is player s name: James
What is player s name: Luke
What is player s name: Ryan
What is player s name: Grant
What is player s name: Joshua
C BASEBALL LINEUP PROJECT
Page of
Enter the averages for each player:
What is Jacksons average:
What is Bens average:
What is Harpers average:
What is Masons average:
What is Seans average:
What is Roberts average:
What is Haydens average:
What is Jamess average:
What is Lukes average:
What is Ryans average:
What is Grants average:
What is Joshuas average:
Game lineup and field positions:
Name Inning Inning Inning Inning Inning
Joshua RF B RCF OUT P
Mason RCF B LCF B OUT
James B RF OUT C LF
Ben B RCF P OUT SS
Grant P OUT B LCF RF
Robert LCF B OUT B RCF
Hayden LF SS RF B C
Harper C LCF SS RF B
Luke SS LF B P OUT
Ryan OUT C LF RCF B
Sean B OUT B LF B
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 D array, a first index whole number, and a last index whole number. The
void function must use the divideandconquer 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started