Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSC1720 Program 1 Quidditch Team Manager (And please no spam answers since they dont cover everything I need) Link that is in the picture for

CSC1720 Program 1 Quidditch Team Manager (And please no spam answers since they dont cover everything I need)

Link that is in the picture for the rules of Quidditch-https://www.cornellcollege.edu/intramurals/PDFs/Quidditch%20Rules.pdf%20for%20IM.pdf

Requirements

1. Write a program that defines a struct to store data about a quidditch

player: player's name (first only)

position (chaser, keeper, beater, seeker)

number of minutes played

total number of points scored (10 for goals with quaffle, 30 for snitch capture)

total number of dismounts (knocked off broom by bludgers thrown by beaters)

total number of goals blocked (made by keeper)

total number of bludgeons (made by beaters)

2. Your program must include a function to input data from a file specified by the user when the program begins. The input file should include player data for exactly 10 players in the order listed above, one player at a time. If a category is not applicable to a player due to their position, the file will indicate a 0 for that category. A value of 0 should then be output for that category.

3. Your program should also include a function to display data about a single player, a function to display data about all players, a function to sort the array by number of minutes played(highest to lowest) and a function to output the top scoring players name with their score.

4. Your program should be menu driven. Include all menu choices mentioned in #3 above as well as an option to quit. If the user chooses to quit, the user should then be asked whether they want to output the table with all players data to a file.

image text in transcribed

image text in transcribed

Picture of the example data file

image text in transcribed

CSC1720 Program 1 - Quidditch Team Manager Requirements 1. Write a program that defines a struct to store data about a quidditch player: player's name (first only) position (chaser, keeper, beater, seeker) number of minutes played total number of points scored (10 for goals with quaffle, 30 for snitch capture) total number of dismounts (knocked off broom by bludgers thrown by beaters) total number of goals blocked (made by keeper) total number of bludgeons (made by beaters) All stats are cumulative for a quidditch season. Declare an array of structs to hold information for 10 quidditch players. Details for the non-magical version of the game can be found at: hhtrs://www.comellcollese.edwintramurals/PDFs/Quidditch\%20Rules.pdP\%20for\%/20IM.pdf A sample datafile can be found at: /home/faculty/ktitus/csc1720public/quiddata.txt 2. Your program must include a function to input data from a file specified by the user when the program begins. The input file should include player data for exactly 10 players in the order listed above, one player at a time. If a category is not applicable to a player due to their position, the file will indicate a 0 for that category. A value of 0 should then be output for that category. 3. Your program should also include a function to display data about a single player, a function to display data about all players, a function to sort the array by number of minutes played (highest to lowest) and a function to output the top scoring player's name with their score. 4. Your program should be menu driven. Include all menu choices mentioned in \#3 above as well as an option to quit. If the user chooses to quit, the user should then be asked whether they want to output the table with all players' data to a file. General Instructions and Additional Information: 1. This program is an individual effort event. Please remember that you should not use the code of others. Every keystroke in your program must be your own. You may not collaborate on the details of your solution and may not share your code with or show your code to anyone else. You may ask classmates how to resolve specific compiler errors, but you may otherwise only get help from the SI, other CS tutors, or me. Any help you receive must be described in a comment. 2. Be sure your program includes a comment block at the top that includes your name, the date, and a brief description of what the program does. Include at the end of that comment block any notes to me about things you know that don't work or any other relevant information. Any code that doesn't compile, but that you want me to see, should appear commented out in the body of the program. 3. Part of your project grade will be based on style, readability, and documentation. Use indentation, white space, and other stylistic techniques to make your code easier to read. Adhere to the stylistic guidelines used in the textbook. Use single line or multi-line comments in the body of your functions, as appropriate. It's always good to explain your thought process: what seems obvious to you isn't always obvious to someone else reading your code. Use descriptive variable names and, where appropriate, constants. Sample output for display all, sorting and top scorer menu options with quiddata . txt data file: Hermione is the top scoring player with 170 points. Quidditch Team Roster Ordered by Minutes Played ci4. tbaker@spock: /csc1720 1 Harry Seeker 4551201200 2 Hermione Chaser 312170300 3 Ron Keeper 20607180 4 Ginny Seeker 20160600 5 Fred Chaser 300130400 6 Dobby Beater 1202602 7 Draco Beater 42204037 8 Minerva Keeper 28602290 9 Luna Chaser 386160300 10 Voldemort Beater 39300053 The ycmd server SHUT DOWN (restart with ':YcmRest...it. Follow the instructions in the documentation. 1,1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Evaluate the importance of diversity in the workforce.

Answered: 1 week ago

Question

Identify the legal standards of the recruitment process.

Answered: 1 week ago