Find Jobs
Hire Freelancers

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

$10-30 USD

Ολοκληρώθηκε
Αναρτήθηκε περίπου 8 χρόνια πριν

$10-30 USD

Πληρωμή κατά την παράδοση
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.
Ταυτότητα εργασίας: 9685800

Σχετικά με την εργασία

4 προτάσεις
Απομακρυσμένη Εργασία
Ενεργός/ή 8 χρόνια πριν

Ψάχνεις τρόπο για να κερδίσεις μερικά χρήματα;

Πλεονεκτήματα πλειοδοσίας στο Freelancer

Καθόρισε τον προϋπολογισμό σου και το χρονοδιάγραμμα
Πληρώσου για τη δουλειά σου
Περίγραψε την πρόταση σου
Η εγγραφή και η πλειοδοσία σε εργασίες είναι δωρεάν
Βραβεύτηκε στον/στην:
Avatar Χρήστη
$20 USD σε 0 ημέρα
2,8 (3 αξιολογήσεις)
2,4
2,4
4 freelancers δίνουν μια μέση προσφορά $35 USD για αυτή τη δουλειά
Avatar Χρήστη
A proposal has not yet been provided
$49 USD σε 1 ημέρα
5,0 (39 αξιολογήσεις)
6,1
6,1

Σχετικά με τον πελάτη

Σημαία της UNITED STATES
Saratoga, United States
0,0
0
Επαληθευμένη μέθοδος πληρωμής
Μέλος από Φεβ 17, 2016

Επαλήθευση Πελάτη

Ευχαριστούμε! Σου έχουμε στείλει ένα email με ένα σύνδεσμο για να διεκδικήσεις τη δωρεάν πίστωση σου.
Κάτι πήγε στραβά κατά την προσπάθεια αποστολής του email σου. Παρακαλούμε δοκίμασε ξανά.
Εγγεγραμμένοι Χρήστες Συνολικές Αναρτημένες Δουλειές
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Φόρτωση προεπισκόπησης
Δόθηκε πρόσβαση για Geolocation.
Η σύνδεση σου έχει λήξει και τώρα έχεις αποσυνδεθεί. Παρακαλούμε συνδέσου ξανά.