Question: INSTRUCTIONS: 1. Create a C program for the Secret Potions of the Geffen Witches. The player should be able to do the following: a. Select

INSTRUCTIONS:

1. Create a C program for the Secret Potions of the Geffen Witches. The player should be able to do the following:

a. Select from Main menu The main menu must show the list of places the player can travel to. The player should be able to choose where they want to go. They can teleport to 6 places: Geffen, Holgrehenn Store, Taal Lake, Galathea Deep, Dagupan Mangrove Forests, and Mindanao Current. They should also have the option to check their bag and to exit the program.

b. Check Bag If the player chooses to check their bag, the items they have acquired, and its corresponding quantities should be displayed. An option to go back to the list of places is also displayed.

c. Craft Potion When the player is in Geffen, they should have the options to craft Water Chakra Potion, Air Chakra Potion, Wind Chakra Potion, Fire Chakra Potion, and Ymirs Avatar Potion. They should also have the option to go back to the list of places. If the player chooses to craft a potion, the materials needed and its location must be displayed, and they should have the options to proceed crafting, and to cancel crafting. If the player chooses to proceed and they have the required materials, the potion must be crafted and automatically placed in the bag. After which, the options for crafting will be shown again. If the player chooses to cancel crafting, they should also go back to the list of potions.

d. Catch Fish When the player is in Taal Lake, Galathea Deep, Dagupan Mangrove Forests, or Mindanao Current, they should have the option to catch a fish. The fish that they can catch depends on the location as shown in Table 3. The catch rate of the extremely rare fishes (i.e. Scaleless Blackfish, Mariana Snailfish, Mudskippers, and Hillstream Loaches) is 10%, while the normal fishes (i.e. Bangus, Tilapia, Tuna, and Sardines) is 90%. The player should also have the option to catch a fish with magical bait which increases the catch rate of extremely rare fishes to 30%, while the normal fishes will be 70%. (Think carefully about how you can implement the catch rates). When the fish is caught based on the catch rate, it must be automatically placed in the bag. There should also be an option for going back to the list of places.

e. Buy Items When the player is in Holgrehenn Store, they should have the option to buy items, to sell items, and to go back to the list of places. If the player chooses to buy items, the program must display the list of items that can be bought, and its prices as shown in Table 2. Then, the player can specify which item they want to buy one type at a time and the quantity. If the player has enough Ymir coins, the item will be bought and automatically placed in the bag, then the price will be deducted from the current Ymir coins of the player. If the player doesnt have enough Ymir coins, the program should tell them. They may also cancel buying which leads them back to the options in Holgrehenn Store.

f. Sell Items - When the player is in Holgrehenn Store, they should have the option to buy items, to sell items, and to go back to the list of places. If the player chooses to sell items, the program must display the list of items that can be sold, and its prices as shown in Table 3. Then, the player can specify which item they want to sell one type at a time and its quantity. If the player has the item with the quantity specified, these will be removed from the bag, then the player will receive the corresponding Ymir coins for the items. They may also cancel selling which leads them back to the options in Holgrehenn Store.

2. Write a test script for the program. Test and debug your program.

3. Follow the Linux Kernel coding standard.

Note though that you are NOT ALLOWED to do the following: to declare and use global variables (i.e., variables declared outside any function) to use goto statements (i.e., to jump from code segments to code segments), to use the break statement to exit a block other than switch blocks, to use the return statement or exit statement to prematurely terminate a loop or function or program, to use the exit statement to prematurely terminate a loop or to terminate the function or program, and to call the main() function to repeat the process instead of using loops. It is best that you perform your coding incrementally. This means: dividing the program specification into subproblems, and solving each problem separately according to your algorithm; coding the solutions to the subproblems one at a time. Once youre done coding the solution for one subproblem, apply testing and debugging.

While coding, you have to include internal documentation in your programs. You are expected to have the following: File comments or Introductory comments Function comments In-line comments

IMPORTANT POINTS TO REMEMBER: 1. You are required to implement the project using the C language (C99 and NOT C++). Make sure you know how to compile and run in both the IDE (DEV-C++) and the command prompt via gcc Wall -o 2. The implementation will require you to: Create and Use Functions Note: Non-use of self-defined functions will merit a grade of 0 for the machine project. Appropriately use conditional statements, loops and other constructs discussed in class (Do not use brute force solution. You are not allowed to use goto label statements, exit statements. You are required to pass parameters to functions and not allowed to declare global or static variables.) Consistently employ coding conventions

DO NOT FORGET TO CREATE A TEST SCRIPT TABLE AS SHOWN IN THE ATTACHMENT BELOW INSTRUCTIONS: 1. Create a C program for the Secret Potions of theGeffen Witches. The player should be able to do the following: a.Select from Main menu The main menu must show the list of

In the town of Geffen, witches from all over the country have gathered to discover the secret behind the Ymir's Avatar Potion, the only potion that can help cultivate the Avatar's powers. The Ymir's Avatar Potion can only be crafted in Geffen, and it requires the following materials: Fire Chakra Potion, Water Chakra Potion, Earth Chakra Potion, and Air Chakra Potion. These potions can also be crafted in Geffen. The materials for each potion are shown in the Table 1. Materials and their locations for crafting each of the required potions for Ymir's Avatar Potion. Table 1. Materials and their locations for crafting each of the required potions for Ymir's Avatar Potion. Potion Materials Location Scaleless Blackfish Taal Lake Gold Holgrehenn Store Fire Chakra Majestic Water Holgrehenn Store Wondrous Vinegar Holgrehenn Store Mariana Snailfish Galathea Deep Gold Holgrehenn Store Water Chakra Majestic Water Holgrehenn Store Wondrous Vinegar Holgrehenn Store Mudskippers Dagupan Mangrove Forests Gold Holgrehenn Store Earth Chakra Majestic Water Holgrehenn Store Wondrous Vinegar Holgrehenn Store Hillsfream Louches Mindanao Current Gold Holgrehenn Store Air Chakra Majestic Water Holgrehenn Store Wondrous Vinegar Holgrehenn Store The secret behind the Chakra potions crafted in Geffen are the extremely rare fishes that can be gathered from the 4 fishing sites: Taal Lake, Galathea Deep, Dagupan Mangrove Forests, and Mindanao Current. As these are extremely rare fishes, the chances of catching them from their respective locations are only 10%. This chance can be increased to 30% by using the Magical Bait which can be bought from Holgrehenn Store. The other materials for crafting the Chakra potions can also be bought from Holgrehenn Store. The currency used in Geffen is Ymir gold coins. A list of the items that can be bought from Holgrehenn Store is shown in Table 2. Table 2. Items that can be bought from Holgrehenn Store, and its corresponding prices. Item to buy Price Gold 750 Ymir Majestic Water 100 Ymir Wondrous Vinegar 150 Ymir Magical Bait 300 Ymir As you qualify and enter the town of Geffen, you will be given a magical fishing rod. Geffen is a prosperous town, so you don't need to worry about your living expenses. Housing and food are provided for free to all citizens of Geffen. If you want to earn Ymir coins to buy the materials that you need for the potions, you can sell the fishes that you can catch from the fishing sites. Holgrehenn buys these fishes too. Table 3 shows the fishing sites, the corresponding fishes that can be caught from the sites, and their prices when sold to Holgrehenn. Images used in this document are edited from the game Ragnarok X, and the cartoon series The Last Airbender. Table 3. Fishing site locations, and the fishes that can be caught and its corresponding prices when sold. Location Item to sell Price Scaleless Blackfish 1000 Ymir Taal Lake Tilapia 35 Ymir Mariana Snailfish 1000 Ymir Galathea Deep Sardines 40 Ymir Mudskippers 1000 Ymir Dagupan Mangrove Forests Bangus 50 Ymir Hillstream Logches 1000 Ymir Mindanao Current Tuna 45 Ymir ** Test Script should be in a table format, with header as shown below. There should be at least 3 distinct test classes (as indicated in the description) per function. There is no need to test functions which are only for screen design. Expected Result Actual Result P/F Sample Input Function Name # Test Description either from the user or passed to the function) checkMaterials 1 The player has Scaleless Blackfish = 0 no materials at Gold = 0 Majestic Water = 0 Wondrous Vinegar = 0 Return False P Returned False all. Return False F Returned True 2 The player lacks Scaleless Blackfish = 1 some of the Gold = 0 materials. Majestic Water = 2 Wondrous Vinegar = 3 3 Return True P Returned True The player has Scaleless Blackfish = 1 all the Gold = materials. Majestic Water - 2 Wondrous Vinegar = 1 = 3 In the town of Geffen, witches from all over the country have gathered to discover the secret behind the Ymir's Avatar Potion, the only potion that can help cultivate the Avatar's powers. The Ymir's Avatar Potion can only be crafted in Geffen, and it requires the following materials: Fire Chakra Potion, Water Chakra Potion, Earth Chakra Potion, and Air Chakra Potion. These potions can also be crafted in Geffen. The materials for each potion are shown in the Table 1. Materials and their locations for crafting each of the required potions for Ymir's Avatar Potion. Table 1. Materials and their locations for crafting each of the required potions for Ymir's Avatar Potion. Potion Materials Location Scaleless Blackfish Taal Lake Gold Holgrehenn Store Fire Chakra Majestic Water Holgrehenn Store Wondrous Vinegar Holgrehenn Store Mariana Snailfish Galathea Deep Gold Holgrehenn Store Water Chakra Majestic Water Holgrehenn Store Wondrous Vinegar Holgrehenn Store Mudskippers Dagupan Mangrove Forests Gold Holgrehenn Store Earth Chakra Majestic Water Holgrehenn Store Wondrous Vinegar Holgrehenn Store Hillsfream Louches Mindanao Current Gold Holgrehenn Store Air Chakra Majestic Water Holgrehenn Store Wondrous Vinegar Holgrehenn Store The secret behind the Chakra potions crafted in Geffen are the extremely rare fishes that can be gathered from the 4 fishing sites: Taal Lake, Galathea Deep, Dagupan Mangrove Forests, and Mindanao Current. As these are extremely rare fishes, the chances of catching them from their respective locations are only 10%. This chance can be increased to 30% by using the Magical Bait which can be bought from Holgrehenn Store. The other materials for crafting the Chakra potions can also be bought from Holgrehenn Store. The currency used in Geffen is Ymir gold coins. A list of the items that can be bought from Holgrehenn Store is shown in Table 2. Table 2. Items that can be bought from Holgrehenn Store, and its corresponding prices. Item to buy Price Gold 750 Ymir Majestic Water 100 Ymir Wondrous Vinegar 150 Ymir Magical Bait 300 Ymir As you qualify and enter the town of Geffen, you will be given a magical fishing rod. Geffen is a prosperous town, so you don't need to worry about your living expenses. Housing and food are provided for free to all citizens of Geffen. If you want to earn Ymir coins to buy the materials that you need for the potions, you can sell the fishes that you can catch from the fishing sites. Holgrehenn buys these fishes too. Table 3 shows the fishing sites, the corresponding fishes that can be caught from the sites, and their prices when sold to Holgrehenn. Images used in this document are edited from the game Ragnarok X, and the cartoon series The Last Airbender. Table 3. Fishing site locations, and the fishes that can be caught and its corresponding prices when sold. Location Item to sell Price Scaleless Blackfish 1000 Ymir Taal Lake Tilapia 35 Ymir Mariana Snailfish 1000 Ymir Galathea Deep Sardines 40 Ymir Mudskippers 1000 Ymir Dagupan Mangrove Forests Bangus 50 Ymir Hillstream Logches 1000 Ymir Mindanao Current Tuna 45 Ymir ** Test Script should be in a table format, with header as shown below. There should be at least 3 distinct test classes (as indicated in the description) per function. There is no need to test functions which are only for screen design. Expected Result Actual Result P/F Sample Input Function Name # Test Description either from the user or passed to the function) checkMaterials 1 The player has Scaleless Blackfish = 0 no materials at Gold = 0 Majestic Water = 0 Wondrous Vinegar = 0 Return False P Returned False all. Return False F Returned True 2 The player lacks Scaleless Blackfish = 1 some of the Gold = 0 materials. Majestic Water = 2 Wondrous Vinegar = 3 3 Return True P Returned True The player has Scaleless Blackfish = 1 all the Gold = materials. Majestic Water - 2 Wondrous Vinegar = 1 = 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!