Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C PROGRAMMING LANGUAGE DATA STRUCTURE Genshin Impact Genshin Impact is an application used by Genshin Impact players to list all the in-game characters that players

C PROGRAMMING LANGUAGE DATA STRUCTURE

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Genshin Impact Genshin Impact is an application used by Genshin Impact players to list all the in-game characters that players own. This application will be developed using AVL Tree to store the data. The descriptions of the program are: The program main menu will show the total of primogems that player have and the menu consists of 4 menus there are: 1. Add Character 2. View Character List 3. Sell Character 4. Exit and Delete All Data Senslin Impact EEEEEEE Primogems: EEEEEEEEEEEEEE 1. Add Character 2. View Character List 3. Sell Character 4. Exit and Delete all Data Choose: Figure 1. Main Menn . If the user chooses Add New Character (Menu 1): Ask user to input the following data: Character ID o Validate that the ID must be unique and follow the format rules defined below Format ID : CHXXX X-> Number between 0 and 9 e.g. : CH029 Character Name o Validate that the name must be between 3 and 25 characters inclusively. Also, validate so every word in the character name must start with an uppercase letter . Character Attack o Validate that the attack must be between 1000 and 3000 inclusively Character Price Validate that the price must be more than 1000 Input character ID (CHXXX, X -> number][must unique]: chasd Input character ID (CHXXX, X -> number][must unique]: Chila Input character ID (CHXXX, X -> number][must unique]: CHee1 Input character name (3-25 Character][every word start with capital]: A Input character name (3-25 Character] every word start with capital]: Zhong li Input character name (3-25 Character][every word start with capital]: Zhong Li Input character attack (1000-3000): 999 Input character attack (1000-3000]: 1000 Input character price (more than 1000): 1000 Input character price (more than 1000): 1001 Figure 2. Input Character Validation Insert the new character to the AVL tree with ID as key and show the character detail Added Character Details . ID : CHOD1 Name : Zhong Li Attack : 1000 Price : 1001 Press enter to continue... Figure 3. Added Character Detail If user chooses View Character List (Menu 2): - If there is no character in the tree, show "No data found!" No data found! Press enter to continue... Figwe 4. No Data Found Otherwise, ask user to input view method. Validate that the method must either equal to "pre", "in", or "post" (case sensitive) Please select view method [pre in post][to return): Figwe 5. Input View Metod Validate if user input O, back to main menu If user chooses pre, show the data using Pre-Order method ID Name Attack Price CHOO2 klee | CH001 Zhong Li | CH884 | Diluc 1 | Xiao | CHOOS | Jean Press enter to continue. 2000 1000 2500 2580 15ee! 2009 1001 1600 2500 1600 BE Figwe 6. Character List in Pre-Order If user chooses in, show the data using In-Order method | ID Name Attack Price | CH201 | Zhong Li CHBO2 Klee Xiao | CH884 | Diluc | CHO05 | Jean =EEEEEEE Press enter to continue. 1eee 2000 25ee 25ee 1500 | 1001 2880 2500 1600 1680 ===== Figure 7. Character List in In-Order If user chooses post, show the data using Post-Order method SEEEEE | ID Name | Attack Price 1001 CH201 | Zhong Li CHOE3 Xiao CHO05 Jean CH884 | Diluc | CHOC2 | Klee ========= Press enter to continue. 1000 250e 15ee 2500 2eee 2560 1600 1600 2eee Figure 8. Character Listir Post-Order . If user chooses Sell Character (Menu 3): - If there is no character in the tree, show No data found!" No data found! Press enter to continue... Figure 9. No Data Found Otherwise, show the character list and ask user to input Character ID | ID Name Attack Price | CHO01 | Zhong Li CHOO2 Klee CHOE3 Xiao CHee4 | Diluc CHOES | Jean 1eee 200e 2500 2500 1500 1ee1 2000 2500 1600 16ee i === Choose ID [to return): Figure 10. Delete Menu If user input O, redirect back to main menu Otherwise, ask user to input Character ID. Validate character id must exist in the AVL Tree Choose ID (e to return): che12 ID doesn't exists! Choose ID [e to return): CH291 Are you sure you want to delete this data? [YN case-insensitive): Figure 11. Delete Character ID Validation Ask user to confirm delete data, input must be "Y" or "N" (case insensitive) o If user choose "Y" or "y" Delete the character from the AVL * Show character details and add character price to total of primogems Deleted Character Details ID : CHOD1 Name : Zhong Li Attack : 1800 Price : 1001 Press enter to continue. Figure 12. Deleted Character Detail Senslin Impact Primoges : 1091 SESSES 1. Add Character 2. View Character List 3. Sell Character 4. Exit and Delete all Data Choose: Figwe 13. Updated Primogems o Otherwise if user chooses "N" or "n", return to main menu If user chooses Exit and Delete all character (Menu 4), delete all characters in the AVL Tree, show thank you message and close the program Thank you for using this application! Press enter to continue.. Figure 14. Thank You Message Genshin Impact Genshin Impact is an application used by Genshin Impact players to list all the in-game characters that players own. This application will be developed using AVL Tree to store the data. The descriptions of the program are: The program main menu will show the total of primogems that player have and the menu consists of 4 menus there are: 1. Add Character 2. View Character List 3. Sell Character 4. Exit and Delete All Data Senslin Impact EEEEEEE Primogems: EEEEEEEEEEEEEE 1. Add Character 2. View Character List 3. Sell Character 4. Exit and Delete all Data Choose: Figure 1. Main Menn . If the user chooses Add New Character (Menu 1): Ask user to input the following data: Character ID o Validate that the ID must be unique and follow the format rules defined below Format ID : CHXXX X-> Number between 0 and 9 e.g. : CH029 Character Name o Validate that the name must be between 3 and 25 characters inclusively. Also, validate so every word in the character name must start with an uppercase letter . Character Attack o Validate that the attack must be between 1000 and 3000 inclusively Character Price Validate that the price must be more than 1000 Input character ID (CHXXX, X -> number][must unique]: chasd Input character ID (CHXXX, X -> number][must unique]: Chila Input character ID (CHXXX, X -> number][must unique]: CHee1 Input character name (3-25 Character][every word start with capital]: A Input character name (3-25 Character] every word start with capital]: Zhong li Input character name (3-25 Character][every word start with capital]: Zhong Li Input character attack (1000-3000): 999 Input character attack (1000-3000]: 1000 Input character price (more than 1000): 1000 Input character price (more than 1000): 1001 Figure 2. Input Character Validation Insert the new character to the AVL tree with ID as key and show the character detail Added Character Details . ID : CHOD1 Name : Zhong Li Attack : 1000 Price : 1001 Press enter to continue... Figure 3. Added Character Detail If user chooses View Character List (Menu 2): - If there is no character in the tree, show "No data found!" No data found! Press enter to continue... Figwe 4. No Data Found Otherwise, ask user to input view method. Validate that the method must either equal to "pre", "in", or "post" (case sensitive) Please select view method [pre in post][to return): Figwe 5. Input View Metod Validate if user input O, back to main menu If user chooses pre, show the data using Pre-Order method ID Name Attack Price CHOO2 klee | CH001 Zhong Li | CH884 | Diluc 1 | Xiao | CHOOS | Jean Press enter to continue. 2000 1000 2500 2580 15ee! 2009 1001 1600 2500 1600 BE Figwe 6. Character List in Pre-Order If user chooses in, show the data using In-Order method | ID Name Attack Price | CH201 | Zhong Li CHBO2 Klee Xiao | CH884 | Diluc | CHO05 | Jean =EEEEEEE Press enter to continue. 1eee 2000 25ee 25ee 1500 | 1001 2880 2500 1600 1680 ===== Figure 7. Character List in In-Order If user chooses post, show the data using Post-Order method SEEEEE | ID Name | Attack Price 1001 CH201 | Zhong Li CHOE3 Xiao CHO05 Jean CH884 | Diluc | CHOC2 | Klee ========= Press enter to continue. 1000 250e 15ee 2500 2eee 2560 1600 1600 2eee Figure 8. Character Listir Post-Order . If user chooses Sell Character (Menu 3): - If there is no character in the tree, show No data found!" No data found! Press enter to continue... Figure 9. No Data Found Otherwise, show the character list and ask user to input Character ID | ID Name Attack Price | CHO01 | Zhong Li CHOO2 Klee CHOE3 Xiao CHee4 | Diluc CHOES | Jean 1eee 200e 2500 2500 1500 1ee1 2000 2500 1600 16ee i === Choose ID [to return): Figure 10. Delete Menu If user input O, redirect back to main menu Otherwise, ask user to input Character ID. Validate character id must exist in the AVL Tree Choose ID (e to return): che12 ID doesn't exists! Choose ID [e to return): CH291 Are you sure you want to delete this data? [YN case-insensitive): Figure 11. Delete Character ID Validation Ask user to confirm delete data, input must be "Y" or "N" (case insensitive) o If user choose "Y" or "y" Delete the character from the AVL * Show character details and add character price to total of primogems Deleted Character Details ID : CHOD1 Name : Zhong Li Attack : 1800 Price : 1001 Press enter to continue. Figure 12. Deleted Character Detail Senslin Impact Primoges : 1091 SESSES 1. Add Character 2. View Character List 3. Sell Character 4. Exit and Delete all Data Choose: Figwe 13. Updated Primogems o Otherwise if user chooses "N" or "n", return to main menu If user chooses Exit and Delete all character (Menu 4), delete all characters in the AVL Tree, show thank you message and close the program Thank you for using this application! Press enter to continue.. Figure 14. Thank You Message

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