Question: Lab Practice 6 : Functions Write a program that prints a menu ( use a void function for it ) with the following options: 1
Lab Practice : Functions
Write a program that prints a menu use a void function for it with the following options:
Palindromes. A palindrome is a string that is spelled the same way forward and backward. Examples of palindromes include "radar", "bob", "racecar". Write a Boolean function called testPalindrome that returns true if the user inputted word is palindrome, and false otherwise. Note that like an array, the square brackets operator can be used to iterate through the characters in a string.
Guessthenumber Game. Write a function that plays "guess the number" game as follows: Your program randomly generates an integer from to The program displays the following:
Please guess a number between :
The player then types a first guess. The program responds with one of the following:
Excellent! It took you X tries to guess correctly.
Out of range. Try again.
Too Low. Try again.
Too high. Try again.
If the player's guess is incorrect, your program should loop until the player finally guesses correctly. The ranges your program prints will automatically close in as to exclude incorrect guesses. For example, say you guess then your program will print:
Please guess a number between :
This is to help the player narrow in on the correct number. If the player inputs a number out of range, then the ranges will not update.
These are example of the lab output
Welcome user!
Please select from the following:
a Palindrome checker.
b Guessthenumber Game.
c Exit.
Choice: a
Enter a word to test: radar
radar is a palindrome.
Please select from the following:
a Palindrome checker.
b Guessthenumber Game.
c Exit.
Choice: a
Enter a word to test: snter a word to test: richardnixon
richardnixon is NOT a palindrome.
Please select from the following:
a Palindrome checker.
b Guessthenumber Game. Please select from the following:
a Palindrome checker.
b Guessthenumber Game.
c Exit.
Choice: b
Plese guess a number between :
Too Low. Try again.
Plese guess a number between :
Too Low. Try again.
Plese guess a number between :
Out of range. Are you even trying?
Plese guess a number between :
Too Low. Try again.
Plese guess a number between :
Too high. Try again. cout rNum
; Prints random number generated for testi.
Plese guess a number between :
Too high. Try again.
Plese guess a number between :
Too high. Try again.
Plese guess a number between :
Too Low. Try again.
Plese guess a number between :
Too Low. Try again.
Plese guess a number between :
CongLatuRations!
You're Winner!
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
