Related questions
Design a python
An
1. Prompt the user to enter a string at the keyboard
2. As long as the string is not "end"
2.1 Display the string, along with an appropriate message
2.2 Examine the current character of the string
2.2.1 If it's alphabetic, update the alphabetic_counter and the total_alphabetic_counter
2.2.2 If it's numeric, update the numeric _counter and the total_numeric_counter
2.2.3 If it's a lower_case letter, update the lower_case _counter and the
total_lower_case_counter
2.2.4 If it's a upper_case letter, update the upper_case _counter and the
total_upper_case_counter
2.2.5 If it's a whitespace character, update the whitespace _counter and the
total_whitespace_counter
2.2.6 Continue from step 2.2 with the next character until done with this string
2.3 Display the alphabetic_counter, numeric _counter, lower_case _counter,
upper_case _counter, and whitespace _counter, each on a separate line,
and each along with an appropriate message
2.4 Prompt the user to enter another string at the keyboard
3. Display the total_alphabetic_counter, total_ numeric _counter,
total_lower_case _counter, total_ upper_case _counter, and total_ whitespace _counter,
each on a separate line, and each along with an appropriate message
4. Stop
=================================================================================
NOTE 1:
The program will process alphabetic, numeric, and whitespace characters only.
NOTE 2:
A sample program run is attached below. It illustrates user's interactions with the program:
=======================================================================
You need to set up a Python solution that is complete and workable.
For your solution to be complete, you must:
Prompt the user for the specific input data asked for within the problem statement
Does the appropriate processing on the entered input data
Provide the output data asked for within the problem statement to the user
For your solution to be workable:
Your solution should be free of any type of errors (syntax, run-time, logic)
You may want to develop an algorithm first, using pseudocode or flowchart
You do NOT need to turn in any algorithm
Trending nowThis is a popular solution!
Step by stepSolved in 7 steps with 3 images
- Write a program that prompts the user for a month name and a month day. Your program will examine the month and the day to determine the season. Your program will then display the date's season (Winter, Spring, Summer or Autumn). The input is a string to represent the month and an int to represent the day. See chart below for the range of dates within seasons. Ex: If the input is: April 11 the output is: Spring The dates for each season in the northern hemisphere are:Spring: March 20 - June 20Summer: June 21 - September 21Autumn: September 22 - December 20Winter: December 21 - March 19arrow_forwardPlease in python , thank youarrow_forwarda)Create a string variable and assign to it your favorite color. b) Write Matlab code that prompts the user to guess your favorite color. After the user has had 3 attempts, the program displays the message "Incorrect. You run out of chances!" and stops.arrow_forward
- a. Write a program that reads your id and full name and display. And also display the index of first letter and last letter of your full name. b. Modify above program, Declare a string course, let your program read course from user, check if course is not equal to comp2002, clear the string otherwise concatenate course and " Computer Science Department". C. Modify above program declare a string college="". If string college is empty then assign a new string "College of Science".arrow_forwardPython Programmingarrow_forwardAssume the variable s has been assigned a string. Write code that displays " stop " if s is equal to " end ". Otherwise, display " go ". Pythonarrow_forward
- Take input a string and create a new string where 'if' is added to the front of the input string. If the string already begins with 'if', return the string unchanged.Sample Input:"if else""else"Sample Output:if elseif elsearrow_forward3 – Write a python program that prompt the user to enter a string and count the number of words and characters in that string without using built-in methods.arrow_forwardSuppose you are to design a program that prompts the user to enter a String and displays the number of vowels, consonants, and spaces. Assume letters A, E, I, O, U (or a, e, i, o, u) as the vowels. Check the two sample runs and carefully read the instructions below. Two Sample Run: Enter a String: I Love CPS*1231 LOL!!! "The number of vowels is 4" ●くろまる Instructions: Prompt the user to input a String (the String may contain spaces). Based on the inputted String, check each character using a Loop to count the total number of vowels, consonants, and spaces. Print the total number of vowels, consonants, and spaces. The count displayed must account for all the vowels and consonants in the String regardless of case-sensitivity (upper or lower case). Print double quotes in the beginning and end of the output as shown in the Sample Run. Hint: ●くろまる "The number of consonants is 7" "The number of spaces is 3" ●くろまる ●くろまる O charAt(index) and length() method from the String class, toUpperCase(ch) (or...arrow_forward
- Python Programmingarrow_forwardThe following loop will end when.. a =" while a!='xyz': a = input() a. the user inputs the string 'xyz' (without the apostrophes) b. the user inputs anything other than the string 'xyz' (with the apostrophes) c. the user inputs the string 'xyz' (with the apostrophes) d. the user inputs anything other than the string 'xyz' (without the apostrophes)arrow_forwardCreate a program in pythonthat asks the user to input a number between 20 and 99. The program must then print out the number in English words. If the user does not enter a value between 20 and 99 display an error message stating that the input is not within a valid range.arrow_forward
- Text book imageDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationText book imageStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONText book imageDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- Text book imageC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONText book imageDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningText book imageProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education