Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create the following python modules (.py files) and upload them to Grader Than for testing. Your submission should contain a total of seven different python

Create the following python modules (.py files) and upload them to Grader Than for testing. Your submission should contain a total of seven different python modules with the corresponding names specified below. Make sure your code in the scripts is within an if __name__ == "__main__": block or else Grader Than will not be able to grade it.

reverseInput.py

This module accepts user input from the console and then prints the reverse of the user input to the console. This script should not print any other text to the console other than the reverse user input. Do not print any input prompt.

Example: input: Hello World output: dlroW olleH

waitForCorrectWord.py

This script should print a single word that it is expecting the user to type in. Then it should wait for the user to type the word in. If the user types in a word that does not match the word you initially printed, the script should print a single line message saying the input was incorrect and then wait for the user to try again. The script should repeat this process an indefinite amount of times until the user types the correct value.

printMathResult.py

Write a python script that will wait for three user inputted values in the following order:

  1. a string operation which will be one of the following ('+', '-', '*', '/')
  2. a number between 1-20
  3. a number between 1-20

Once the user inputs the three values, it is supposed to perform the given operation (The first inputted value) on the numeric values (The second and third inputted values) and print the result to the console. This script should not print any other text to the console other than the result of the mathematical operation. Do not print any input prompt.

Example: input1: + input2: 1 input3: 1

output: 2

sumRange.py

This script will accept two user inputs that are whole numbers. The first user input will always be less than the second input. This script should calculate the sum of every other whole number between the inputs. Then print the sum of the numbers to the console.

This script should not print any other text to the console other than the result of the mathematical operation. Do not print any input prompt.

Example: input: 5 input: 9

output: 21 => 5+7+9

sumInputs.py

Write a script that accepts an arbitrary number of user inputs. When you receive a user input value that is a number, add the number to a growing sum of numbers received as user input. When you receive a user input value that is not a number, skip it. When you receive two consecutive user input values that are not numbers, stop accepting user inputs. Then Multiply the total number of user inputs received (numbers and non-numbers) times the growing sum of received numbers. Finally, print the result to the console as the last line.

This script should not print any other text to the console other than the result of the mathematical operation. Do not print any input prompt.

Example: input: 9 input: 1 input: 0 input: wicked input: 2 input: pepper input: salt

output: 84

sum = 12, total inputs = 7, 12 * 7 = 84

splitString.py

Write a script that accepts an arbitrary number of user inputs. Every time this script receives a string, it should add the string to a growing string. Newly added strings should be added to the growing string at the index equal to the newly added string's length. If the newly added string's length is equal to or larger than the growing string, this script should add the new string to the end of the growing string. When this script receives a blank input, this application should stop receiving input and print the growing string to the console.

This script should not print any other text to the console other than the result of the growing string. Do not print any input prompt.

Example: input: 'hello' -> growing string: 'hello' input: 'bear' -> growing string: 'hellbearo' input: 'cow' -> growing string: 'helcowlbearo' input: 'disestablishment' -> growing string: 'helcowlbearodisestablishment' input: '' -> growing string: 'helcowlbearodisestablishment'

output: 'helcowlbearodisestablishment'

numberGuess.py

You will create a script that allows a user to guess a hardcoded number you have picked. If the user's input is too high, you should print a message saying "the guess is too high", if the number is too low, you should print a message saying "the guess is too low". The first user input this script receives is going to be the total number of guesses that the user will have. All subsequent inputs will be guesses. If the user guesses the correct value print "correct" and the application should quit. If the user fails to guess the correct value within the specified number of guesses print, "you lose" then quit.

Programmatic Description: Pick a number between 1 and 10 hard code it in this script. Accept a user input, which will be a number; this inputted value is going to be the total number of attempts the user will have to guess the number. This number will be greater than zero. Then allow the user to guess the specified total number of times. If the guess is too high print, "the guess is too high" if the guess is too low print, "the guess is too low". If the user correctly guesses the number in the allotted number of guesses print "correct" then immediately quit. And if they fail to guess the correct number print, "you lose" then immediately quit.

This script should not print any other text to the console other than the outputs outlined above. Do not print any input prompt.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions

Question

2. Identify issues/causes for the apparent conflict.

Answered: 1 week ago