Find Jobs
Hire Freelancers

C++ Basketball, structs, C-strings, and dynamic memory allocation

$10-30 USD

Terminado
Publicado hace más de 8 años

$10-30 USD

Pagado a la entrega
Program Steps Read a file containing team names, their conferences and divisions. This data will be stored in an array of structs. Memory for each of the team names must be allocated dynamically. Read a file containing scores. Each record in the file must be parsed to determine the winning and losing team. The number of wins, losses and percentage must be calculated using the data in the scores file. The array of structs must be sorted by conference, division, and percentage to produce output equivalent to that shown below. Program Requirements Use the input files, team name file and scores file. Scores updated 1/17/16 (games played through 1/17/16) Use this struct to store the data for each team: struct NBA_Team { char* name; char conference[8]; char division[10]; unsigned short wins; unsigned short losses; float pct; }; Use char arrays to store all character data for this assignment. The C++ string class may not be used in this assignment. The program output must show the current standings using the team input data and the percentage calculations. Program Output Your output should look quite similar to the following. Note: the actual statistics will be different when you use the current scores file. Output updated 1/17/16 (contains games played through 1/17/16) Western Conference Southwest Division W L Pct San Antonio Spurs 36 6 0.857 Memphis Grizzlies 23 19 0.548 Dallas Mavericks 23 19 0.548 Houston Rockets 21 20 0.512 New Orleans Pelicans 13 26 0.333 Pacific Division W L Pct Golden State Warriors 37 4 0.902 Los Angeles Clippers 26 14 0.650 Sacramento Kings 17 23 0.425 Phoenix Suns 13 29 0.310 Los Angeles Lakers 9 33 0.214 Northwest Division W L Pct Oklahoma City Thunder 30 12 0.714 Utah Jazz 18 22 0.450 Portland Trail Blazers 18 25 0.419 Denver Nuggets 16 25 0.390 Minnesota Timberwolves 13 29 0.310 Eastern Conference Southeast Division W L Pct Atlanta Hawks 24 17 0.585 Miami Heat 23 18 0.561 Orlando Magic 20 19 0.513 Washington Wizards 19 20 0.487 Charlotte Hornets 18 22 0.450 Central Division W L Pct Cleveland Cavaliers 28 10 0.737 Chicago Bulls 23 16 0.590 Detroit Pistons 22 18 0.550 Indiana Pacers 22 19 0.537 Milwaukee Bucks 18 25 0.419 Atlantic Division W L Pct Toronto Raptors 25 15 0.625 Boston Celtics 22 19 0.537 New York Knicks 20 22 0.476 Brooklyn Nets 11 30 0.268 Philadelphia 76ers 5 37 0.119 Program Notes There are 30 NBA teams, 15 in each conference. The conferences are Western and Eastern. There are 6 divisions with 5 teams in each division. The scores file will also require specific parsing techniques. Skip over the date and time columns (the first 12 bytes). Skip over the mostly blank records that show the tie score before overtime. To parse a scores record, you can use strncpy and strtok(). To calculate the team percentage, use the formula: pct = wins / total games played To sort the data for the output standings, you might want to create a "sortkey" function, consisting of the conference, division, and percentage. Then you can sort using the "sortkey". And finally, as usual, this assignment contains some subtle aspects. Be sure to start early and allow enough time to ask the instructor for help. Recommendation, when you start, use a small subset of the scores file to make sure you are correctly calculating the statistics.
ID del proyecto: 9685800

Información sobre el proyecto

4 propuestas
Proyecto remoto
Activo hace 8 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
$20 USD en 0 día
2,8 (3 comentarios)
2,4
2,4
4 freelancers están ofertando un promedio de $35 USD por este trabajo
Avatar del usuario
A proposal has not yet been provided
$49 USD en 1 día
5,0 (39 comentarios)
6,1
6,1

Sobre este cliente

Bandera de UNITED STATES
Saratoga, United States
0,0
0
Forma de pago verificada
Miembro desde feb 17, 2016

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.