# COP3502C Computer Science 1 Dr. Andrew Steinberg Spring 2022 Programming Assignment 5 The Unfair Game Max Points 100 Due: 4/22/2022 at 11:59pm Background Story of this Assignment You and 1999 friends...

COP3502C Computer Science 1
Dr. Andrew Steinberg
Spring 2022
Programming Assignment 5
The Unfair Game
Max Points 100
Due: 4/22/2022 at 11:59pm
Background Story of this Assignment
You and 1999 friends are playing this new strategic battle game. The game requires two teams only. This
means you and 999 people (1000 total) will be on one team together. In order to get the game started,
teams need to be formed. The group votes you and Ron to be team captains. Ron is a
and new person
who just moved into town and doesn’t know anyone or anything about them (including strengths and
weaknesses). You however know everyone (including strengths and weaknesses)! You plan to use this to
your advantage to pick the best players. Your objective is to pick the best players for the team so you can
eat Ron.
Have fun and start early (seriously start early)! Make sure to see the TAs and ULAs for help EARLY! DO
NOT PROCASTINATE!
Assignment Details
In this assignment you are going to create the best team and make the game unfair. In order to find out if
you made the game truly unfair, take the average ranking of both teams. The results should be completely
different and not even close. Dr. Steinberg has provided a test script for a scenario to test out. Each player
has a name (only first name) and an associated rank that determines their capabilities. The rank ranges
from 1 to 5 (1 being the best and 5 being the worst). Each player can be represented as a typedef structure
as follows.
typedef struct{
char * name;
dynamic string
int rank;
}player_t;
1. The name component is a dynamic string that represents the first name of the player.
2. The rank component represents the rank (which can be 1, 2, 3, 4, or 5).
The Provided Skeleton File
For this assignment you were provided with a skeleton (program5_Skeleton.c) file that contains
the following content. This section discusses the content of the provided skeleton file that you
may not be familiar with.
Line 5 defines the macro constant representing the number of players total.
Line 13 shows a function prototype for an implemented function that reads player names from a
text file and assigns them a rank.
Lines 19-39 shows the main function. Inside the main function 3 dynamic a
ays are created.
One will contain the roster of ALL players and the other two are the teams.
COP3502C Computer Science 1
Dr. Andrew Steinberg
Spring 2022
Lines 44-62 shows the user defined function scanRoster that collects the name and assigns the
anking of the player randomly. Do not change this code!
The Function Prototypes
For this assignment, the function prototypes are not provided for you. At this point in the course
you should have the necessary skills to apply function decomposition. Do not write your entire
solution in the main function or one/two user defined function(s). Use good practice!
Requirements
• The output must match exactly (this includes case sensitivity, white space, and even new lines).
Any differences in the output will cause the grader script to say the output is not co
ect. Test
with the script provided in order to receive potential full credit. Points will be deducted!
• Do not remove ANY content of the skeleton that was provided for you. Your code will be tested
through a script that relies on this main function. Any changes to this will result in your program
not working fully which will lead to point deductions that will not be fixed! You will need to add
to the skeleton file to get it to work.
• Name your C file program5_lastname_firstname.c where lastname and
firstname is your last and first name respectively. Please make sure it matches the spelling
exactly how it is registered in Webcourses. Points will be deducted if the file is not named
co
ectly.
• You will need to make sure there are no memory leaks!
• Do not change the typedef structure that was provided for you.
• Your solution must run in ?(?????) time where n is the number of players. If the solution
doesn’t satisfy this requirement, points will be deducted.
• Use function decomposition! If you don’t use function decomposition, then points will be
deducted.
Tips in Being Successful
Here are some tips and tricks that will help you with this assignment and make the experience enjoyable.
• Do not try to write out all the code and build it at the end to find syntax e
ors. For each new line
of code written (my rule of thumb is 2-3 lines), build it to see if it compiles successfully. It will
go a long way!
• After any successful build, run the code to see what happens and what cu
ent state you are at
with the program writing so you know what to do next! If the program performs what you
expected, you can then move onto the next step of the code writing. If you try to write everything
at once and build it successfully to find out it doesn’t work properly, you will get frustrated trying
find out the logical e
or in your code! Remember, logical e
ors are the hardest to fix and
identify in a program!
• Start the assignment early! Do not wait last minute (the day of) to begin the assignment.
TAs/ULAs and the Instructor! We are here to help!!! You can also utilize the discussion board on
COP3502C Computer Science 1
Dr. Andrew Steinberg
Spring 2022
Webcourses to share a general question about the program as long as it doesn’t violate the

Liam
Noah
Olive
Elijah
William
James
Benjamin
Lucas
Henry
Alexande
Mason
Michael
Ethan
Daniel
Jaco
Logan
Jackson
Levi
Sebastian
Mateo
Jack
Owen
Theodore
Aiden
Samuel
Joseph
John
David
Wyatt
Matthew
Luke
Ashe
Carte
Julian
Grayson
Leo
Jayden
Ga
iel
Isaac
Lincoln
Anthony
Hudson
Dylan
Ezra
Thomas
Charles
Christophe
Jaxon
Maverick
Josiah
Isaiah
Andrew
Elias
Joshua
Nathan
Cale
Ryan
Miles
Eli
Nolan
Christian
Aaron
Cameron
Ezekiel
Colton
Luca
Landon
Hunte
Jonathan
Santiago
Axel
Easton
Coope
Jeremiah
Angel
Roman
Conno
Jameson
Robert
Greyson
Jordan
Ian
Carson
Jaxson
Leonardo
Nicholas
Dominic
Austin
Everett
Brooks
Xavie
Kai
Jose
Parke
Jace
Wesley
Kayden
Silas
Bennett
Declan
Waylon
Weston
Evan
Emmett
Micah
Ryde
Beau
Damian
Brayden
Gael
Rowan
Ha
ison
Bryson
Sawye
Ami
Kingston
Jason
Giovanni
Vincent
Ayden
Chase
Myles
Diego
Nathaniel
Legend
Jonah
Rive
Tyle
Cole
Braxton
George
Milo
Zachary
Ashton
Luis
Jaspe
Kaiden
Gavin
Bentley
Calvin
Zion
Juan
Maxwell
Max
Ryke
Carlos
Emmanuel
Jayce
Lorenzo
Ivan
Jude
August
Kevin
Malachi
Elliott
Rhett
Arche
Karte
Arthu
Luka
Elliot
Thiago
Brandon
Camden
Justin
Jesus
King
Theo
Enzo
Matteo
Emiliano
Dean
Hayden
Finn
Brody
Antonio
Abel
Alex
Tristan
Graham
Zayden
Judah
Xande
Miguel
Atlas
Messiah
Ba
ett
Tucke
Timothy
Alan
Edward
Leon
Dawson
Eric
Ace
Victo
A
aham
Nicolas
Jesse
Charlie
Patrick
Walke
Joel
Richard
Beckett
Blake
Alejandro
Avery
Grant
Pete
Osca
Matias
Amari
Lukas
Andres
Arlo
Colt
Kyrie
Steven
Felix
Preston
Marcus
Holden
Emilio
Remington
Jeremy
Kale
Brantley
Bryce
Mark
Knox
Israel
Phoenix
Kobe
Nash
Griffin
Kenneth
Kyle
Hayes
Jax
Rafael
Beckham
Javie
Maximus
Simon
Paul
Oma
Kash
Lane
Bryan
Riley
Zane
Louis
Aidan
Paxton
Maximiliano
Karson
Cash
Cayden
Emerson
Tobias
Ronan
Brian
Dallas
Jorge
Walte
Josue
Khalil
Damien
Jett
Kairo
Zande
Andre
Cohen
Crew
Hendrix
Colin
Chance
Malakai
Clayton
Daxton
Malcolm
Lennox
Martin
Kayson
Bodhi
Francisco
Cody
Erick
Kameron
Atticus
Dante
Jensen
Cruz
Finley
Joaquin
Anderson
Gunne
Zayn
Derek
Raymond
Kyle
Angelo
Reid
Spence
Nico
Jaylen
Jake
Prince
Manuel
Ali
Gideon
Stephen
Ellis
Orion
Rylan
Eduardo
Mario
Rory
Cristian
Odin
Tanne
Julius
Callum
Sean
Kane
Ricardo
Travis
Wa
en
Fernando
Titus
Leonel
Edwin
Cairo
Co
in
Dakota
Ismael
Colson
Killian
Majo
Tate
Gianni
Elian
Remy
Lawson
Niko
Nasi
Armani
Ezequiel
Marshall
Hecto
Desmond
Kason
Ga
ett
Jared
Cyrus
Russell
Cesa
Tyson
Malik
Donovan
Jaxton
Romeo
Nehemiah
Sergio
Ike
Caiden
Jay
Pablo
Devin
Jeffrey
Otto
Kamari
Ronin
Johnny
Clark
Ari
Marco
Edga
Bowen
Jaiden
Zayne
Sullivan
Jayceon
Sterling
Andy
Cono
Raiden
Royal
Royce
Solomon
Trevo
Winston
Emanuel
Finnegan
Pedro
Luciano
Harvey
Franklin
Noel
Troy
Princeton
Johnathan
Erik
Fabian
Oakley
Rhys
Porte
Hugo
Frank
Damon
Kendrick
Mathias
Milan
Peyton
Wilde
Callan
Gregory
Seth
Matthias
Briggs
I
ahim
Roberto
Conne
Quinn
Kashton
Sage
Santino
Kolton
Alijah
Dominick
Zyaire
Apollo
Kylo
Reed
Philip
Kian
Shawn
Kaison
Leonidas
Ayaan
Lucca
Memphis
Ford
Baylo
Kyson
Uriel
Allen
Collin
Ruben
Archie
Dalton
Esteban
Fo
est
Alonzo
Isaias
Leland
Jase
Dax
Kasen
Gage
Kamden
Marcos
Jamison
Francis
Hank
Alexis
Tripp
Frederick
Jonas
Stetson
Cassius
Izaiah
Eden
Maximilian
Rocco
Tatum
Keegan
Aziel
Moses
Bruce
Lewis
Braylen
Omari
Mack
Augustus
Enrique
Armando
Pierce
Moises
Asa
Shane
Emmitt
Soren
Dorian
Keanu
Zaiden
Raphael
Deacon
Abdiel
Kieran
Phillip
Ryland
Zachariah
Casey
Zaire
Albert
Bake
Corey
Kylan
Denve
Gunna
Jayson
Drew
Callen
Jasiah
Drake
Kannon
Braylon
Sonny
Bo
Moshe
Huxley
Quentin
Rowen
Santana
Cannon
Kenzo
Wells
Julio
Nikolai
Jalen
Makai
Benson
De
ick
Gerardo
Davis
A
am
Mohamed
Ronald
Raul
Arjun
Dexte
Kaysen
Jaime
Scott
Lawrence
Ariel
Skyle
Danny
Roland
Chandle
Yusuf
Samson
Case
Zain
Roy
Rodrigo
Sutton
Boone
Saint
Saul
Jaziel
Hezekiah
Alec
Arturo
Jamari
Jaxtyn
Julien
Koa
Reece
Landen
Koda
Darius
Sylas
Ares
Kyree
Boston
Keith
Taylo
Johan
Edison
Sincere
Watson
Je
y
Nikolas
Quincy
Shepherd
Brycen
Marvin
Dariel
Axton
Donald
Bodie
Finnley
Onyx
Rayan
Raylan
Brixton
Colby
Shiloh
Valentino
Layton
Trenton
Landyn
Alessandro
Gustavo
Ledge
Ridge
Ande
Ahmed
Kingsley
Issac
Mauricio
Tony
Leonard
Mohammed
Uriah
Duke
Kareem
Lucian
Marcelo
Aarav
Leandro
Reign
Clay
Kohen
Dennis
Sami
Ermias
Otis
Emi
Nixon
Ty
Sam
Fletche
Wilson
Dustin
Hamza
Bryant
Flynn
Lionel
Cason
Jami
Dakari
Justice
Dillon
Layne
Zaid
Alden
Nelson
Devon
Titan
Chris
Khari
Zeke
Noe
Alberto
Roge
Brock
Rex
Quinton
Alvin
Cullen
Azariah
Harlan
Kellan
Lennon
Marcel
Keaton
Morgan
Ricky
Trey
Karsyn
Langston
Mille
Chaim
Amias
Curtis
Lachlan
Amos
Anakin
Krew
Tomas
Jefferson
Yosef
Bruno
Ko
in
Augustine
Cayson
Mathew
Vihaan
Jamie
Clyde
Brendan
Jagge
Carmelo
Ha
y
Nathanael
Mitchell
Da
en
Ray
Jedidiah
Jimmy
Lochlan
Bellamy
Eddie
Rayden
Reese
Stanley
Joe
Houston
Douglas
Vincenzo
Casen
Emery
Joziah
Leighton
Marcellus
Atreus
Aron
Hugh
Musa
Tommy
Alfredo
Junio
Neil
Westley
Banks
Eliel
Melvin
Maximo
Bria
Colten
Lance
Nova
Trace
Axl
Ramon
Vicente
Brennan
Caspian
Remi
Deandre
Legacy
Lee
Valentin
Ben
Louie
Westin
Wayne
Benicio
Grey
Zayd
Gatlin
Mekhi
Orlando
Bjorn
Harley
Alonso
Rio
Aldo
Byron
Eliseo
Ernesto
Talon
Brecken
Kace
Kellen
Enoch
Kiaan
Lian
Creed
Rohan
Callahan
Jaxxon
Ocean
Crosby
Dash
Gary
Mylo
Ira
Magnus
Salem
Abdullah
Kye
Tru
Forest
Jon
Misael
Carl
Hassan
Emory
Kristian
Alaric
Am
ose
Dario
Allan
Bode
Boden
Juelz
Kristophe
Genesis
Idris
Amee
Anders
Darian
Kase
Aryan
Dane
Guillermo
Elisha
Jakobe
Thatche
Eugene
Ishaan
La
y
Wesson
Yehuda
Alvaro
Bo
y
Bronson
Dilan
Kole
Kyro
Tristen
Blaze
Brayan
Kamryn
Demetrius
Maurice
Arian
Kabi
Rocky
Rudy
Randy
Rodney
Yousef
Felipe
Robin
Aydin
Dio
Kaise
Van
Brodie
London
Answered 5 days AfterApr 08, 2022

## Solution

Vaibhav answered on Apr 14 2022
SOLUTION.PDF