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).

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education