Question
Ragnarok Online is a MMORPG that was popular 3 years ago, but today it still has a lot of big fans. Mr. Setiawan, a Market
Ragnarok Online is a MMORPG that was popular 3 years ago, but today it still has a lot of big fans. Mr. Setiawan, a Market Research from LYTO, wants to make a program that contains all the players in that game so he asks you to make the program using a binary search tree concept. Here are the descriptions of the program:
- Program consists of 4 menus:
1. Add (PUSH) New Ragnarok Online Player
2. Show Ragnarok Online Player Profile
3. InOrder, PreOrder, PostOrder
4. Exit
- If user choosesAdd (PUSH) New Ragnarok Online Player, then:
- Ask user to inputplayers name. The length ofplayers namemust bebetween 1 and 20 characters.
- Ask user to inputplayers job. Validate that the players job must beSwordsman, Thief, Mage, or Archer with case sensitive.
- Then calculatethe level of player. The level is a random numberbetween 1 and 100.
Show the message:Player Got Level: [Level]
- Push the data into the tree based onthe level of the player.
- If data has been successfully inputted, then show the messageSuccess to add new player
- If trees level is already at 4, then show the message:Maximum tree level is 4
- If user choosesShow Ragnarok Online Player Profile, then:
- Ask user to inputplayers name. The length ofplayers namemust bebetween1 and 20 characters.
- If data can be found in the tree, show the players profile with format:
Players Level : [Players Level]
Players Name : [Players Name]
Players Job : [Players Job]
- If data cannot be found, then show the messageData that you requested cannot be found
- If user choosesInOrder, PreOrder, PostOrder,then:
- If there is no data in the tree, show the messageThere is no data left to be shown
-If data is already in the tree, show the inorder, preorder, and postorder of the tree. Please show the level of the player only!
- If user choosesExit, then:
- Delete all data in the linked list.
- Program ends.
Step 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