Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

YU-GI-OH! For this assignment, you will be provided one text file named monsters.txt containing the description of monsters in the following format: Blue-Eyes White Dragon

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

YU-GI-OH! For this assignment, you will be provided one text file named monsters.txt containing the description of monsters in the following format: Blue-Eyes White Dragon 3000 2500 The monsters will be read into an array as a struct. Your task is to sort and search accordingly with a given feature (attack or defence). BASE 80% marks Write a program that, after a list of structures is read into an array from the file monsters.txt, does the following operations: 1. Prompts the user with which sorting algorithm (bubble sort algorithm or insertion sort algorithm) the array should be sorted a. bubble sort olgorithm defined in bubble_sort_pseudocode.txt b. Insertion sort algorithm defined in the CS115 Lab Webpage 2. Prompts the user for which feature (attack or defence) the array should be sorted 3. Sort the array and display it 4. Prompts the user for a value of the considered feature and return the position of a monster in the array a. If more than one monster has that value, you only have to show the position of only one of them b. You should use here the binary search procedure defined in the CS115 Lab Webpage TIER 1 90% marks BASE Apply the Program Organization Principles: Separation of Interface And Implementation TIER 2 100% marks BASE + TIER 1 + 1. Keep searching (MUST USE binary search procedure) for the given feature while the user wants to continue 2. If more than one monster has the given feature, display all of them TIER 2 SAMPLE OUTPUT YU-GI-0000000000000 >> TRE CARDS: Blue-Eyes White Dragon ATK/3000 DEX/2500 Dark Magician ATK/2500 DEF/2100 IT Exodia The Forbidden One | ND00 DN5000 6 Celtic Guardian ATK/1400 DEF/1200 Copycat ATX/O DEF/0 Time Wizard ATK/500 DEF/400 Blue-Eyes White Dragon ATK/3000 DEF/2500 TL Baby Dragon ATK/1200 DEF/700 Kuriboh ATK/300 DEF/200 010 Summoned Skull ATK/2500 DE/1200 011 II Blue-Eyes White Dragon L A TE/3000 DEF/2500 II L 012 Red-Eyes 3. Dragon ATK/2400 DEF/200 >> CHOOSE THE SORTING ALGORITEM: 1 - BUBBLE SORT ALGORITHM 2 - INSERTION SORT ALGORITHM > CHOOSE THE SORTING ALGORITHM: 1 - BUBBLE SORT ALGORITHM 2 - INSERTION SORT ALGORITHM >> SORT BY: 1 - ATK 2 - DEF >> BUBBLE SORT ALGORITHM SORTED BY ATK: Copycat ATK/O DET/O Kuciboh ATK/300 DEF/200 Tine Ward AZK/500 DET/400 Baby DEBO ATK/1200 DEF/700 5 Celtic Guardian ATR/1000 DEP/1200 Red-Eyes 3. DERGO ATK/2400 DEF/200 Summoned Skull ATX/2500 DEF/1200 Dark Magician ATK/2500 DEF/2100 Blue-Eyes White Dragon ATK/3000 DET/2500 IL 010 Blue-Eyes White Dragon ATK/3000 DET/2500 #11 Blue-Eyes White Dragon A TK/3000 DET/2500 012 Exodia The Forbidden One A TK/5000 DEP/SODO T L >> ENTER THE ATK TO SEARCH: > ATK 2500 IS FOUND AT POSITION(S) >> 1788 *** DO YOU WANT TO CONTINUE (Y/N) *** > ENTER THE ATK TO SEARCH: > NUMBER 55 DOES NOT EXIST AS ATK IN THE DECK **** DO YOU WANT TO CONTINUE (Y/N) ****** DEFEATED => THE CARDS: TL Blue-Eyes White Dragon ATI/3000 DEF/2500 Dark Magician ATX/2500 DEF/2100 T1 Exodia The Torbidden One ATK/S000 DE/S000 Celtie Guardian ATK/1400 DEY/1200 5 Copyent ATK/O DEF/0 Time Ward TK/SGO DEX/400 L A L Blue-Eyes White Dragon ATK/3000 DEX/2500 Baby Dragon A TK/1200 DEF/700 Kursbeh A TE/300 DET/200 D D 010 Summoned Skull ATK/2500 DET/1200 Blue-Eyes White Dragon A TE/3000 SEK/2500 D D e d-Eyes 2. Denon A TK/2400 DE/200 D >> CHOOSE THE SORTING ALGORITI: 1-BBBLE SORT ALGORITI 2 - INSERTION SORT ALGORITEM >> SORT BY: ATK > BUBBLE SORT ALGORITID SORTED BY AIK: Copycat ATK/O DEF/O boh ATK/300 DEF/200 ATK/500 DEF/400 Baby Dragon ATK/1200 DET/700 Celtie Guardian ATK/1400 DET/1200 Red-Eyes B. Dengan ATK/2400 DET/200 Summoned skull ATK/2500 DEY/1200 IL D Dark Magician A TK/2500 DEF/2100 Blue-Eyes White Dragon ATK/3000 DEX/2500 II Blue-Eyes White Dragon ATK/3000 DET/2500 Blue-Eyes White Dragon ATX/1000 DEF/2500 Exodia Tha Torbidden One ATK/5000 DE/S000 >> ENTER THE ATK TO SEARCH: ATK 2500 IS FOLIE AT POSITION(S) 008 - DO YOU WANT TO CONTINUE (Y/N) > TER THE ATK TO SEARCH: > MRER SS DOES NOT EXIST AS ATK IN THE DECK ******* DO YOU WANT TO CONTINUE (Y/N) DEFEATED BASE 80% marks Write a program that, after a list of structures is read into an array from the file monsters.txt, does the following operations: 1. Prompts the user with which sorting algorithm (bubble sort algorithm or insertion sort algorithm) the array should be sorted a. bubble sort algorithm defined in bubble sort pseudocode.txt b. insertion sort algorithm defined in the CS115 Lab Webpage 2. Prompts the user for which feature (attack or defence) the array should be sorted 3. Sort the array and display it 4. Prompts the user for a value of the considered feature and return the position of a monster in the array a. If more than one monster has that value, you only have to show the position of only one of them b. You should use here the binary search procedure defined in the CS115 Lab Webpage TIER 1 90% marks BASE+ Apply the Program Organization Principles: Separation of Interface And Implementation TIER 2 100% marks BASE + TIER 1 + 1. Keep searching (MUST USE binary search procedure) for the given feature while the user wants to continue 2. If more than one monster has the given feature, display all of them TIER 2 SAMPLE OUTPUT YU-GI-OH! For this assignment, you will be provided one text file named monsters.txt containing the description of monsters in the following format: Blue-Eyes White Dragon 3000 2500 The monsters will be read into an array as a struct. Your task is to sort and search accordingly with a given feature (attack or defence). BASE 80% marks Write a program that, after a list of structures is read into an array from the file monsters.txt, does the following operations: 1. Prompts the user with which sorting algorithm (bubble sort algorithm or insertion sort algorithm) the array should be sorted a. bubble sort olgorithm defined in bubble_sort_pseudocode.txt b. Insertion sort algorithm defined in the CS115 Lab Webpage 2. Prompts the user for which feature (attack or defence) the array should be sorted 3. Sort the array and display it 4. Prompts the user for a value of the considered feature and return the position of a monster in the array a. If more than one monster has that value, you only have to show the position of only one of them b. You should use here the binary search procedure defined in the CS115 Lab Webpage TIER 1 90% marks BASE Apply the Program Organization Principles: Separation of Interface And Implementation TIER 2 100% marks BASE + TIER 1 + 1. Keep searching (MUST USE binary search procedure) for the given feature while the user wants to continue 2. If more than one monster has the given feature, display all of them TIER 2 SAMPLE OUTPUT YU-GI-0000000000000 >> TRE CARDS: Blue-Eyes White Dragon ATK/3000 DEX/2500 Dark Magician ATK/2500 DEF/2100 IT Exodia The Forbidden One | ND00 DN5000 6 Celtic Guardian ATK/1400 DEF/1200 Copycat ATX/O DEF/0 Time Wizard ATK/500 DEF/400 Blue-Eyes White Dragon ATK/3000 DEF/2500 TL Baby Dragon ATK/1200 DEF/700 Kuriboh ATK/300 DEF/200 010 Summoned Skull ATK/2500 DE/1200 011 II Blue-Eyes White Dragon L A TE/3000 DEF/2500 II L 012 Red-Eyes 3. Dragon ATK/2400 DEF/200 >> CHOOSE THE SORTING ALGORITEM: 1 - BUBBLE SORT ALGORITHM 2 - INSERTION SORT ALGORITHM > CHOOSE THE SORTING ALGORITHM: 1 - BUBBLE SORT ALGORITHM 2 - INSERTION SORT ALGORITHM >> SORT BY: 1 - ATK 2 - DEF >> BUBBLE SORT ALGORITHM SORTED BY ATK: Copycat ATK/O DET/O Kuciboh ATK/300 DEF/200 Tine Ward AZK/500 DET/400 Baby DEBO ATK/1200 DEF/700 5 Celtic Guardian ATR/1000 DEP/1200 Red-Eyes 3. DERGO ATK/2400 DEF/200 Summoned Skull ATX/2500 DEF/1200 Dark Magician ATK/2500 DEF/2100 Blue-Eyes White Dragon ATK/3000 DET/2500 IL 010 Blue-Eyes White Dragon ATK/3000 DET/2500 #11 Blue-Eyes White Dragon A TK/3000 DET/2500 012 Exodia The Forbidden One A TK/5000 DEP/SODO T L >> ENTER THE ATK TO SEARCH: > ATK 2500 IS FOUND AT POSITION(S) >> 1788 *** DO YOU WANT TO CONTINUE (Y/N) *** > ENTER THE ATK TO SEARCH: > NUMBER 55 DOES NOT EXIST AS ATK IN THE DECK **** DO YOU WANT TO CONTINUE (Y/N) ****** DEFEATED => THE CARDS: TL Blue-Eyes White Dragon ATI/3000 DEF/2500 Dark Magician ATX/2500 DEF/2100 T1 Exodia The Torbidden One ATK/S000 DE/S000 Celtie Guardian ATK/1400 DEY/1200 5 Copyent ATK/O DEF/0 Time Ward TK/SGO DEX/400 L A L Blue-Eyes White Dragon ATK/3000 DEX/2500 Baby Dragon A TK/1200 DEF/700 Kursbeh A TE/300 DET/200 D D 010 Summoned Skull ATK/2500 DET/1200 Blue-Eyes White Dragon A TE/3000 SEK/2500 D D e d-Eyes 2. Denon A TK/2400 DE/200 D >> CHOOSE THE SORTING ALGORITI: 1-BBBLE SORT ALGORITI 2 - INSERTION SORT ALGORITEM >> SORT BY: ATK > BUBBLE SORT ALGORITID SORTED BY AIK: Copycat ATK/O DEF/O boh ATK/300 DEF/200 ATK/500 DEF/400 Baby Dragon ATK/1200 DET/700 Celtie Guardian ATK/1400 DET/1200 Red-Eyes B. Dengan ATK/2400 DET/200 Summoned skull ATK/2500 DEY/1200 IL D Dark Magician A TK/2500 DEF/2100 Blue-Eyes White Dragon ATK/3000 DEX/2500 II Blue-Eyes White Dragon ATK/3000 DET/2500 Blue-Eyes White Dragon ATX/1000 DEF/2500 Exodia Tha Torbidden One ATK/5000 DE/S000 >> ENTER THE ATK TO SEARCH: ATK 2500 IS FOLIE AT POSITION(S) 008 - DO YOU WANT TO CONTINUE (Y/N) > TER THE ATK TO SEARCH: > MRER SS DOES NOT EXIST AS ATK IN THE DECK ******* DO YOU WANT TO CONTINUE (Y/N) DEFEATED BASE 80% marks Write a program that, after a list of structures is read into an array from the file monsters.txt, does the following operations: 1. Prompts the user with which sorting algorithm (bubble sort algorithm or insertion sort algorithm) the array should be sorted a. bubble sort algorithm defined in bubble sort pseudocode.txt b. insertion sort algorithm defined in the CS115 Lab Webpage 2. Prompts the user for which feature (attack or defence) the array should be sorted 3. Sort the array and display it 4. Prompts the user for a value of the considered feature and return the position of a monster in the array a. If more than one monster has that value, you only have to show the position of only one of them b. You should use here the binary search procedure defined in the CS115 Lab Webpage TIER 1 90% marks BASE+ Apply the Program Organization Principles: Separation of Interface And Implementation TIER 2 100% marks BASE + TIER 1 + 1. Keep searching (MUST USE binary search procedure) for the given feature while the user wants to continue 2. If more than one monster has the given feature, display all of them TIER 2 SAMPLE OUTPUT

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

Recommended Textbook for

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions