Kevin and Stacy want to play a game they have titled 'Vowels or Not?'. Here are the game rules: Both players are given the same string, S. Both players have to make substrings using the letters of the string S. Kevin has to make substrings starting with consonants. Stacy has to make substrings starting with vowels. (Note: vowels are only defined as AEIOU, i.e., in this game, Y is not considered a vowel.) The game ends when both players have made all possible substrings. A player gets +1 point for each occurrence of the substring in the string S. For example, consider the string S= BANANA. Suppose Stacy's vowel beginning substring is ANA. In this case, ANA occurs twice in BANANA. Hence, Stacy will get 2 points for this substring. See the following figure for other examples. Your task is to determine the winner of the game and their score, given a string S.   Your program should: Ask the user whether they want to provide a string for the game (choice 1) OR whether they prefer to have a randomly generated string (choice 2). If the user enters 1, ask the user to enter a string S. The user should enter a string of all uppercase letters. If the user enters 2, ask the user for a seed and then generate a random string of 6 uppercase letters. Random should be seeded as a string. You must generate the random string by creating a list/string of all 26 uppercase letters and then using random.choice() to choose 6 random characters. Output Kevin's score for the game, followed by Stacy's score for the game. Output the winner of the game (Kevin or Stacy) or state the game was a "Draw" (if their scores are the same). Your code should be able to handle any string of uppercase letters of length n (1 ≤ n ≤ 100).

Fundamentals of Information Systems
8th Edition
ISBN:9781305082168
Author:Ralph Stair, George Reynolds
Publisher:Ralph Stair, George Reynolds
Chapter7: Knowledge Management And Specialized Information Systems
Section: Chapter Questions
Problem 8SAT
icon
Related questions
Question
100%

Hello, I am coding in Python 3 and was given this assignment, I currently have no idea where to start and Pseudocode for this problem would be extremely helpful. 

 

Kevin and Stacy want to play a game they have titled 'Vowels or Not?'. Here are the game rules:

  • Both players are given the same string, S.
  • Both players have to make substrings using the letters of the string S.
  • Kevin has to make substrings starting with consonants.
  • Stacy has to make substrings starting with vowels. (Note: vowels are only defined as AEIOU, i.e., in this game, Y is not considered a vowel.)
  • The game ends when both players have made all possible substrings.

A player gets +1 point for each occurrence of the substring in the string S. For example, consider the string S= BANANA. Suppose Stacy's vowel beginning substring is ANA. In this case, ANA occurs twice in BANANA. Hence, Stacy will get 2 points for this substring. See the following figure for other examples. Your task is to determine the winner of the game and their score, given a string S.

 

Your program should:

  1. Ask the user whether they want to provide a string for the game (choice 1) OR whether they prefer to have a randomly generated string (choice 2).
    1. If the user enters 1, ask the user to enter a string S. The user should enter a string of all uppercase letters.
    2. If the user enters 2, ask the user for a seed and then generate a random string of 6 uppercase letters. Random should be seeded as a string. You must generate the random string by creating a list/string of all 26 uppercase letters and then using random.choice() to choose 6 random characters.
  2. Output Kevin's score for the game, followed by Stacy's score for the game.
  3. Output the winner of the game (Kevin or Stacy) or state the game was a "Draw" (if their scores are the same).

Your code should be able to handle any string of uppercase letters of length (1 ≤ n ≤ 100). 

ΒΑNΑΝA
Kevin
Stacy
Words
Score
Words
Score
1
A
3
ВА
1
AN
2
BAN
1
ΑΝΑ
2
BΑNA
1
ΑΝΑΝ
1
ΒΑNAN
1
ΑΝΑΝΑ
1
ΒANΑNA
1
N
2
NA
2
NAN
ΝΑNΑ
1
Total:
12
Total:
9
Transcribed Image Text:ΒΑNΑΝA Kevin Stacy Words Score Words Score 1 A 3 ВА 1 AN 2 BAN 1 ΑΝΑ 2 BΑNA 1 ΑΝΑΝ 1 ΒΑNAN 1 ΑΝΑΝΑ 1 ΒANΑNA 1 N 2 NA 2 NAN ΝΑNΑ 1 Total: 12 Total: 9
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Hiring Problem
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
Fundamentals of Information Systems
Fundamentals of Information Systems
Computer Science
ISBN:
9781305082168
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning