Find Jobs
Hire Freelancers

Baseball Batting averages

$30-250 USD

进行中
已发布大约 11 年前

$30-250 USD

货到付款
Computer Science 1 Programming Assignment 5 Loops 90 Points Baseball Batting Averages A baseball player’s batting average is calculated as the number of hits divided by the official number of at-bats. In calculating official at-bats, walks, sacrifices, and occasions when hit by the pitch are not counted. Write a program that takes an input file containing player numbers and batting records for 20 players. Trips to the plate are coded in the batting record as follows: H – hit, O – out, W – walk, S – sacrifice, P – hit by pitch. The program should read the input file and store the player number and corresponding batting average into two parallel arrays. Print the player numbers and corresponding averages. Then sort the batting average array into ascending order using either the selection sort or bubble sort algorithm and print the sorted array. Calculate and print the average, median, and mode for the batting average array, using a frequency array to find the average. The input file is in the format shown below. A sample input data file is located in D2L under Content for Unit 7. (Hint: Each batting record is followed by a newline character.) Sample input file: 12 HOOOWSHHOOHPWHO 4 OSOHHHWWOHOHOOO 7 WPOHOOHWOHHOWOO Data Validation: If the batting code read from the data file is not ‘W’, ‘H’, O’, or ‘S’, the program should print a message and not include that particular code in the batting average. Use separate functions to: 1. Read the data and find the batting averages. 2. Print the player numbers and batting averages. 3. Sort the averages. 4. Print the sorted averages. 5. Calculate the mean (average) of the batting averages. 6. Calculate the median of the batting averages. 7. Build the frequency array. 8. Calculate the mode of the batting averages. 9. Print the mean, median, and mode for the batting average array. Design your program by completing the CS 150 Program Design Document. Be sure to include a structure chart for the program, the prototype for each function, and a brief description of each function’s purpose. Save the design in a file named [login to view URL] where xxx are your initials and submit it in the Program 7 Design drop box by the date shown in the calendar – this is before the program due date. Code your program. Save it in a file named [login to view URL] where xxx are your initials. Compile, run and test your program. Submit your working .cpp file in the Program 7 dropbox by the date shown in the calendar and drop box tools.
项目 ID: 4458158

关于此项目

3提案
远程项目
活跃11 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
颁发给:
用户头像
Kindly check your inbox. Thanks
$94 USD 在3天之内
5.0 (22条评论)
4.8
4.8
3威客以平均价$145 USD来参与此工作竞价
用户头像
Expert Solution here. Check PM
$242 USD 在4天之内
5.0 (3条评论)
0.5
0.5
用户头像
We can do this for you.
$100 USD 在3天之内
0.0 (0条评论)
0.0
0.0

关于客户

UNITED STATES的国旗
United States
5.0
1
付款方式已验证
会员自4月 24, 2013起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。