C# CODE:
using System;
class MainClass {
public static void Main (string[] args) {
Console.WriteLine ("Enter the Team name:(one time entry)");
string name = Console.ReadLine();
string [,]details=new string[9,3];
int []bats=new int[9];
int []hits=new int[9];
float []avg=new float[9];
float team_avg=0;
for(int i=0;i<9;i++)
{
Console.WriteLine ("Enter the Player name: ");
details[i,0]=name;
details[i,1]=Console.ReadLine();
Console.WriteLine("Enter the Players Position: ");
details[i,2]=Console.ReadLine();
Console.WriteLine("Enter the number of at Bats: ");
string input = Console.ReadLine();
Int32.TryParse(input, out bats[i]);
Console.WriteLine("Enter the number of Hits: ");
input=Console.ReadLine();
Int32.TryParse(input,out hits[i]);
Console.WriteLine("{0}",hits[i]);
avg[i]=(float)hits[i]/(float)bats[i];
Console.WriteLine("{0} batting average is {1}",details[i,1],avg[i].ToString().Substring(1));
team_avg+=avg[i];
}
team_avg/=(float)(9);
Console.WriteLine("The batting average for the {0} is {1}",name,team_avg.ToString().Substring(1));
}
}
Output:

After 8 more players are added:

write a C# program using replit that uses a loop to input # at bats and # of hits for each of the 9 baseball players on...
Write a class that encapsulates the concept of a baseball player with the important attributes (name, position, hits, at bats, batting average). The class will have the following methods: Two constructors (a default and a constructor with all parameters) Accessors, mutators, toString, and equals methods The batting average property will not have a public setter, it will be updated any time the hits and/or at bats is set. The getter will round to three digits (.315 or .276, etc.) All...
1. You will develop a Python program to manage information about baseball players. The program will maintain the following information for each player in the data set: player’s name (string) team identifier (string) games played (integer) at bats (integer) runs scored (integer) hits (integer) doubles (integer) triples (integer) homeruns (integer) batting average (real) slugging percentage (real) The first nine items will be taken from a data file; the last two items will be computed by the program. The following formulas...
c++ A menu-driven program gives the user the option to find statistics about different baseball players. The program reads from a file and stores the data for ten baseball players, including player’s team, name of player, number of homeruns, batting average, and runs batted in. (You can make up your data, or get it online, for example: http://espn.go.com/mlb/statistics ) Write a program that declares a struct to store the data for a player. Declare an array of 10 components to...
Case Study Baseball Team Manager For this case study, you’ll use the programming skills that you learn in Murach’s Python Programming to develop a program that helps a person manage a baseball team. This program stores the data for each player on the team, and it also lets the manager set a starting lineup for each game. After you read chapter 2, you can develop a simple program that calculates the batting average for a player. Then, after you complete...
Chapter 8
Python Case study Baseball Team Manager
For this case study,
you’ll use the programming skills that you learn in Murach’s
Python Programming to develop a program that helps a
person manage a baseball team. This program stores the data for
each player on the team, and it also lets the manager set a
starting lineup for each game. After you read chapter 2, you can
develop a simple program that calculates the batting average for a
player. Then,...
Case Study Baseball Team Manager. CMSC 135 Python Chapter 7 Assignment: Use a file to save the data Update the program so it reads the player data from a file when the program starts andwrites the player data to a file anytime the data is changed What needs to be updated: Specifications Use a CSV file to store the lineup. Store the functions for writing and reading the file of players in a separate module than the rest of the...
Help me figure this problem out, please. Use a list to store the players Update the program so that it allows you to store the players for the starting lineup. This should include the player’s name, position, at bats, and hits. In addition, the program should calculate the player’s batting average from at bats and hits. Console ================================================================ Baseball Team Manager MENU OPTIONS 1 – Display lineup 2 – Add player 3 – Remove player 4 – Move player 5...
Need help writing this code in python.
This what I have so far.
def display_menu():
print("======================================================================")
print(" Baseball Team Manager")
print("MENU OPTIONS")
print("1 - Calculate batting average")
print("2 - Exit program")
print("=====================================================================")
def convert_bat():
option = int(input("Menu option: "))
while option!=2:
if option ==1:
print("Calculate batting average...")
num_at_bats = int(input("Enter official number of at bats:
"))
num_hits = int(input("Enter number of hits: "))
average = num_hits/num_at_bats
print("batting average: ", average)
elif option !=1 and option !=2:
print("Not a valid...
Can you please Test and debug the program below using the following specifications? Many thanks! Create a list of valid entries and the correct results for each set of entries. Then, make sure that the results are correct when you test with these entries. Create a list of invalid entries. These should include entries that test the limits of the allowable values. Then, handle the invalid integers (such as negative integers and unreasonably large integers). In addition, make sure the...
Write a java program that uses a loop to input, from the user not using gui, a collection of values that are the number of steps taken each day for a sequence of days and stores those amounts in an array. the array length should be 31, The user is not required to enter 31 values. the program determines and displays the largest number of steps for a single day, the smallest number of steps for a single day and...