Objective: To design an algorithm and implement a solution using Python programming. To write testcases and test program for correctness. Problem description A palindrome is a sequence of characters that reads the same backward and forward eg: aha is a palindrome. This wikipedia e page contains some application where identifying palindromes are useful. Your goal is to implement a single -player Palindrome game in Python. It involves a player entering several strings and gaining points based on whether the concatenated string is a palindrome or not. The game runs for a certain number of rounds specified by the player. At the end of each round, the player score is updated and displayed. You need to develop a solution in a step-by step manner and also design test cases to test your program for many scenarios based on your understanding of the requirements. Single-player Palindrome game 1) Display a prompt to the player to enter the number of rounds the player has to play the palindrome game 2) While there are remaining rounds for the user: • Play one round of the palindrome game • Calculate number of points added or deducted in this rounds of game • Add the score from this round of game to total game score • Output cumulative score from previous round and current round to the player 3) Output "Game Over" 2.1) Play one round of the palindrome game: 2.1.1) Prompt player to enter a number between 1 and 10. This is the number of strings that the player is prompted to enter. This number can be an odd or even number. 2.1.2) While there are strings to enter for the user: • Prompt player to enter a string • Concatenate the string to the previously entered string 2.1.3) Calculate the score from this round as follows:- o If the player entered an even number and the string is not a palindrome, then player gets 2 points. • If the player entered an odd number and the string is a palindrome, then player gets 5 points. o If the player entered an odd number and the string is not a palindrome, then player loses 1 point. o If none of the above conditions are met, the player neither gains nor loses any points Jinu Kabala
Objective: To design an algorithm and implement a solution using Python programming. To write testcases and test program for correctness. Problem description A palindrome is a sequence of characters that reads the same backward and forward eg: aha is a palindrome. This wikipedia e page contains some application where identifying palindromes are useful. Your goal is to implement a single -player Palindrome game in Python. It involves a player entering several strings and gaining points based on whether the concatenated string is a palindrome or not. The game runs for a certain number of rounds specified by the player. At the end of each round, the player score is updated and displayed. You need to develop a solution in a step-by step manner and also design test cases to test your program for many scenarios based on your understanding of the requirements. Single-player Palindrome game 1) Display a prompt to the player to enter the number of rounds the player has to play the palindrome game 2) While there are remaining rounds for the user: • Play one round of the palindrome game • Calculate number of points added or deducted in this rounds of game • Add the score from this round of game to total game score • Output cumulative score from previous round and current round to the player 3) Output "Game Over" 2.1) Play one round of the palindrome game: 2.1.1) Prompt player to enter a number between 1 and 10. This is the number of strings that the player is prompted to enter. This number can be an odd or even number. 2.1.2) While there are strings to enter for the user: • Prompt player to enter a string • Concatenate the string to the previously entered string 2.1.3) Calculate the score from this round as follows:- o If the player entered an even number and the string is not a palindrome, then player gets 2 points. • If the player entered an odd number and the string is a palindrome, then player gets 5 points. o If the player entered an odd number and the string is not a palindrome, then player loses 1 point. o If none of the above conditions are met, the player neither gains nor loses any points Jinu Kabala
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter15: Recursion
Section: Chapter Questions
Problem 6PE
Related questions
Question
In Python 3!
Palindrome game in python. See the problem in the images attacted :)
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning