Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This question is worth 100% of the assignment mark. Peteplank is arguably the most fearsome pirate ever to sail the seven seas. He was obsessed
This question is worth 100% of the assignment mark. Peteplank is arguably the most fearsome pirate ever to sail the seven seas. He was obsessed with deep-sea diving, magic, and mysteries. The program will start by reading several text files. The first text file is named folio.txt and contains information about all of the maps that are available to the game. It is in the following format: - The first line is a single integer n describing the number of maps. - The remaining n lines are CSV, containing the map name, the year of the map, and the map filename. For example: 3 shanty, 1860, map1.txt motto, 1888, map2.txt rations, 1865, map3.txt 15 ASCII characters. Each character is one of the lowercase letters (a-z) or a digit (0-9). For example, a map may contain this: 105108,111,118,101112,114,111,103,114,97,109,109,105,110,103 If you convert to ASCII characters, you will find: This will be written to the file named secret. txt as plain (not encrypted) text. To keep the secrets safe, this file will be deleted when the player chooses to exit the game. Use the standard Java method delete() found in java. io. File (more documentation found here). USER INTERFACE SAMPLE: Welcome the player when they start the game: Welcome to the Secret of the Island! Choose an option to start the game. The player will be prompted to choose one of six available options. Display the following main menu every time the program expects the user to select one of them: 1-See all maps 2-Open map 3-Decrypt map 4-Write down secret 5-Send information to Captain Lila 0 -Exit Option: - Option 1: will display the maps' information: map name, year, if the map is still encrypted or not, and the secret if it has been revealed already, otherwise it will be blank. - Option 3: will decrypt the map that was chosen previously on option 2, print the secret to the player on the screen and change the map state "Is Encrypted?" to false. - Option 5: will create a new text file and add all of the secrets typed by the player on option 4. - Option 0: will end the game, inform the user that the game is over and delete the secret file. The program will repeatedly ask the user to enter one of these options, prompt for further input if required, and then return to the main menu. The game ends only when the player enters 0 . Notes: - This question requires you to use the concepts of classes, objects, and references. Your solution must include at least one user-defined class beyond the main class. - If the initial folio.txt file cannot be read, display an error and exit the game. - If some of the map files are not found, continue with the maps that are available. If none of the map files are found, display an error and exit the game. Give up (exit) only when necessary, such as when there is no folio or maps. - Decode the ASCII characters in the maps by converting the numeric strings to integers, and then casting the integers to type char. - Ensure that your solution is divided appropriately into functions and/or instance methods, and that all relevant programming standards are followed. 3 shanty, 1669, nap1.txt mattv, 1888 , nap2, txt rat1ons, 18b!, naps.txt 115,191,97,162,195,193,184,116,115103,114,111,111,118,10197,100,100,105,99,116,115 116,119,11199,97,112,116,97,105,116195,11597,186,119,97,121,115114,1155,183,189,116 \# mapa-Notepad Fle Ecit Visw 162,165,115,164 97,119,10999,104,105,112,115 Ln1,Cal1
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