[Solved]Description Wel Looks Like Mario Completed Odyssey Needs Find Something S Time Toad Sugges Q37299148
please show step by step
input1:231140
input2:3 2 1 0 4 0
thanksDescription Wel it looks like Mario has completed his odyssey and now needs to find something to do in his s time. Toad suggested to practice his jump abilities. There are several bridges that lead into castles in the mushroom kingdom. However, this bridge has a set of tiles and each tile is labeled with a number gives Mario special abilities to jump up to an arbitrary amount of tiles forward, so if the tile contains the number 3, Mario can jump 1, 2, or 3 tiles forward. Using the formation of the tiles on a particular bridge, help Mario determine if he can reach the front entrance of the castle using the tiles on the bridge. Let’s look at the implementation details below Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Determine if you are able to reach the last index. You will need to read a set of values from a file and store them into the array, the array size can be declared with size 50 (the input file will not contain more than 50 items). You will need to use an end of file controlled loop but you will need to have a counter in order to correctly place the current number read from the file into the correct position of the array, also for example if you have 25 numbers in you want to cycle through items 0 to 24 in the array not 0 to 49 since elements 25 to 49 contain the file garbage. You will need to write the following functions . void readFromFile(int list, int& size, ifstream& infile) this function takes in the array that will store all the items read from the file using the infile object, the size will be the array counter after every read, in main this val be set to 0 and this function will update the size bool getToLast Index(int list, int size) after calling the readFromFile function, this func- tion will be used to determine if the last index can be reached starting from index 0, you may need to create another temporary array of capacity 50 and only use elements 0 to size 1 (you will also only consider elements 0 to size 1 for list), this temporary array will simply mark which indices are reachable using the jump lengths from the list array, this function returns true if last index is reachable from the starting index or returns false if the last index is not reachable from the starting index Specifications . Comment all your variables and all of your functions . Use a global constant to set the capacity of the array rather than use the integer literal 50 Do not modify the functions’ return types or the parameter types or the amount of parameters described in the functions above and you must implement them as instructed, however you may have additional functions if you wish Do not have any global variables You need to perform error checking when reading in the file name as a string does not exist in the directory Sample Output Jimis-MacBook-Pro : Asst08 VaskoDaGamers g++ Assignmento8.cpp Jimis-MacBook -Pro: Asst08 VaskoDaGamer$ ./a. out Enter filename: InputFile Enter filename: AnotherInputFile.txt Enter filename InputFile.txt Enter filename: A08Inputi.txt Mario FT Jimis -MacBook -Pro: Asst 08 VaskoDaGamer$ ./a. out Enter filename: A08Input2.txt This bridge has the workings of bouser all over it >: Jimis-MacBook -Pro Asst08 VaskoDaGamer$ Show transcribed image text Description Wel it looks like Mario has completed his odyssey and now needs to find something to do in his s time. Toad suggested to practice his jump abilities. There are several bridges that lead into castles in the mushroom kingdom. However, this bridge has a set of tiles and each tile is labeled with a number gives Mario special abilities to jump up to an arbitrary amount of tiles forward, so if the tile contains the number 3, Mario can jump 1, 2, or 3 tiles forward. Using the formation of the tiles on a particular bridge, help Mario determine if he can reach the front entrance of the castle using the tiles on the bridge. Let’s look at the implementation details below Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Determine if you are able to reach the last index. You will need to read a set of values from a file and store them into the array, the array size can be declared with size 50 (the input file will not contain more than 50 items). You will need to use an end of file controlled loop but you will need to have a counter in order to correctly place the current number read from the file into the correct position of the array, also for example if you have 25 numbers in you want to cycle through items 0 to 24 in the array not 0 to 49 since elements 25 to 49 contain the file garbage. You will need to write the following functions . void readFromFile(int list, int& size, ifstream& infile) this function takes in the array that will store all the items read from the file using the infile object, the size will be the array counter after every read, in main this val be set to 0 and this function will update the size bool getToLast Index(int list, int size) after calling the readFromFile function, this func- tion will be used to determine if the last index can be reached starting from index 0, you may need to create another temporary array of capacity 50 and only use elements 0 to size 1 (you will also only consider elements 0 to size 1 for list), this temporary array will simply mark which indices are reachable using the jump lengths from the list array, this function returns true if last index is reachable from the starting index or returns false if the last index is not reachable from the starting index Specifications . Comment all your variables and all of your functions . Use a global constant to set the capacity of the array rather than use the integer literal 50 Do not modify the functions’ return types or the parameter types or the amount of parameters described in the functions above and you must implement them as instructed, however you may have additional functions if you wish Do not have any global variables
You need to perform error checking when reading in the file name as a string does not exist in the directory Sample Output Jimis-MacBook-Pro : Asst08 VaskoDaGamers g++ Assignmento8.cpp Jimis-MacBook -Pro: Asst08 VaskoDaGamer$ ./a. out Enter filename: InputFile Enter filename: AnotherInputFile.txt Enter filename InputFile.txt Enter filename: A08Inputi.txt Mario FT Jimis -MacBook -Pro: Asst 08 VaskoDaGamer$ ./a. out Enter filename: A08Input2.txt This bridge has the workings of bouser all over it >: Jimis-MacBook -Pro Asst08 VaskoDaGamer$
Expert Answer
Answer to Description Wel it looks like Mario has completed his odyssey and now needs to find something to do in his s time. Toad … . . .
OR

