Write a C++ function using basic c++ techniques, for example no pointers to solve the question below. the function must
Posted: Sun Jul 03, 2022 11:22 am
Write a C++ function using basic c++ techniques, forexample no pointers to solve the question below.
the function must randomly selects a puzzle in that categoryfrom the array of Puzzle structs. Since a puzzle in any categorycan be randomly selected, it is important to repeatedly generaterandom numbers until a puzzle in the desired category is found.After selecting the puzzle, it is displayed to the player with theletters “blanked off”. The character ‘#’ is used to hide theletters. If there are spaces or dashes (‘-‘) in the puzzle, theseare revealed to the player.
for example, the puzzle “FULL-LENGTH WALL MIRROR” would bedisplayed as follows: ####-###### #### ######
struct Puzzle{ string category; char puzzle[80]; };
the function must randomly selects a puzzle in that categoryfrom the array of Puzzle structs. Since a puzzle in any categorycan be randomly selected, it is important to repeatedly generaterandom numbers until a puzzle in the desired category is found.After selecting the puzzle, it is displayed to the player with theletters “blanked off”. The character ‘#’ is used to hide theletters. If there are spaces or dashes (‘-‘) in the puzzle, theseare revealed to the player.
for example, the puzzle “FULL-LENGTH WALL MIRROR” would bedisplayed as follows: ####-###### #### ######
struct Puzzle{ string category; char puzzle[80]; };