Answered step by step
Verified Expert Solution
Question
1 Approved Answer
THIS NEEDS TO BE IN C PROGRAM, NOT C++!!!!! The output should look like to 2 screen shots below please, someone finish this by thursday!!!
THIS NEEDS TO BE IN C PROGRAM, NOT C++!!!!!
The output should look like to 2 screen shots below
please, someone finish this by thursday!!!
The purpose of this assignment is to use files to create a high score ranking that will hold a maximum of ten high scores and associated initials. Create a struct called player to hold the initials and associated score. You should declare an array of player in the main function to hold all of the scores. You would need an array of at least 11 elements for this HWw. You should have at least two functions in your code. 1. A function that takes as an argument an array of player and number of entries and sorts the array by score. 2 In your main0 function Print out your name and OUID. Get from the user their initials and score. I recommend using fgets to obtain the initials from the user Check and see if the file sortedscores.txt exists. If it does, read the initials and scores from the file into the player array. Keep track of the number of entries you are reading from the file. You should read no more than 10 player entries, but may at times have to read less than 10 entries. Append the values entered by the user to the array. If the file sortedScores.txt did not exist then the user supplied values should be copied into the first element of the array (index O) Use your sorting function to sort this player array. Note that you have one extra entry in the array now after appending the user supplied entry Write the sorted data back in to the file "sortedScores.txt". Write no more than 10 entries, i.e., the top 10 scores. Print on to the graphics window two high score lists. One, before the user data has been added, and one after. The graphics window should be 400 pixels wide by 600 pixels tall. The current score entered by the user, if on the list, should be highlighted somehow (either an arrow next to it or it could be in a different color, etc.). Some bonus points (max 10%) are possible for making this screen look cool and interesting. Turn in your .c code and two screenshots of the console and graphics window. One screenshot should show when the file did not yet exist, and is being created with the user's input. The other screenshot should have ten scores in both the before and after lists. The current user's score should on the list, but not in 1 or 10 position The purpose of this assignment is to use files to create a high score ranking that will hold a maximum of ten high scores and associated initials. Create a struct called player to hold the initials and associated score. You should declare an array of player in the main function to hold all of the scores. You would need an array of at least 11 elements for this HWw. You should have at least two functions in your code. 1. A function that takes as an argument an array of player and number of entries and sorts the array by score. 2 In your main0 function Print out your name and OUID. Get from the user their initials and score. I recommend using fgets to obtain the initials from the user Check and see if the file sortedscores.txt exists. If it does, read the initials and scores from the file into the player array. Keep track of the number of entries you are reading from the file. You should read no more than 10 player entries, but may at times have to read less than 10 entries. Append the values entered by the user to the array. If the file sortedScores.txt did not exist then the user supplied values should be copied into the first element of the array (index O) Use your sorting function to sort this player array. Note that you have one extra entry in the array now after appending the user supplied entry Write the sorted data back in to the file "sortedScores.txt". Write no more than 10 entries, i.e., the top 10 scores. Print on to the graphics window two high score lists. One, before the user data has been added, and one after. The graphics window should be 400 pixels wide by 600 pixels tall. The current score entered by the user, if on the list, should be highlighted somehow (either an arrow next to it or it could be in a different color, etc.). Some bonus points (max 10%) are possible for making this screen look cool and interesting. Turn in your .c code and two screenshots of the console and graphics window. One screenshot should show when the file did not yet exist, and is being created with the user's input. The other screenshot should have ten scores in both the before and after lists. The current user's score should on the list, but not in 1 or 10 positionStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started