Question: code in C++ 1.5.1 o Button [Display maze] A combo box called cmbQ1_5 has been populated with the names of the three mazes, namely Maze
code in C++![code in C++ 1.5.1 o Button [Display maze] A combo box called](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f311d15c700_84066f311d0c275f.jpg)
1.5.1 o Button [Display maze] A combo box called cmbQ1_5 has been populated with the names of the three mazes, namely Maze 1, Maze 2 and Maze 3. Three text files called Maze 1.txt, Maze 2.txt and Maze 3.txt are provided and stored in the AppData Folder. Each text file contains lines of characters that represent the layout of each maze respectively. The user must select a maze from combo box cmbQ1_5. Code has been provided to clear the component called redQ1_5. Write code to do the following: Extract the name of the selected maze from combo box cmb1_5. Display a suitable message if a text file does NOT exist for the selected maze. Do the following if a text file for the selected maze does exist: o Read ONE line at a time from the text file. o Save EACH line at the correct index in the array arrMaze provided. Display EACH line of the maze with its corresponding line number in the output component redQ1_5. o The lines represent the index of the rows Example of output if Maze 1 was selected from the combo box: Assignment 28 Question 1 Question 1.1 Question 1.2 Question 1.3 Question 1.4 Question1_5 CECECCCCCCCCCCCCC Choose the maze to display @------------- Maze 1 @##-###-#***+-+- 1.5.1 - Display maze -#- #----- @####-#-#-#-#- -@ @---------- 1.5.2 - Longest corridor @---------- @##-#######- -------- @-##---##-#### @----- @-11--11- @------------ @808068-000000 0 1 2 3 5 7 8 9 10 11 12 13 14 15 1.5.1 o Button [Display maze] A combo box called cmbQ1_5 has been populated with the names of the three mazes, namely Maze 1, Maze 2 and Maze 3. Three text files called Maze 1.txt, Maze 2.txt and Maze 3.txt are provided and stored in the AppData Folder. Each text file contains lines of characters that represent the layout of each maze respectively. The user must select a maze from combo box cmbQ1_5. Code has been provided to clear the component called redQ1_5. Write code to do the following: Extract the name of the selected maze from combo box cmb1_5. Display a suitable message if a text file does NOT exist for the selected maze. Do the following if a text file for the selected maze does exist: o Read ONE line at a time from the text file. o Save EACH line at the correct index in the array arrMaze provided. Display EACH line of the maze with its corresponding line number in the output component redQ1_5. o The lines represent the index of the rows Example of output if Maze 1 was selected from the combo box: Assignment 28 Question 1 Question 1.1 Question 1.2 Question 1.3 Question 1.4 Question1_5 CECECCCCCCCCCCCCC Choose the maze to display @------------- Maze 1 @##-###-#***+-+- 1.5.1 - Display maze -#- #----- @####-#-#-#-#- -@ @---------- 1.5.2 - Longest corridor @---------- @##-#######- -------- @-##---##-#### @----- @-11--11- @------------ @808068-000000 0 1 2 3 5 7 8 9 10 11 12 13 14 15
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
