subject

Using the For loop Just like the while and the do-while loop, a for loop allows you to repeat your codes for the desired number of times. In this program, you will count the number of letters of the alphabet, digits, whitespaces and special characters in a user entered string. You need to have three separate counters for the uppercase letters, the lowercase letters and the total number of letters. Any character that is not a letter, a digit or a whitespace is a special character.
To complete this program:
• Using a suitable message, get a string from the user. Note that the string may contain more than one word.
• Inside a while loop, test each character by processing each character of the string one at a time. Think about initialization, termination and update conditions for this loop.
• If it is a letter of the alphabet, a digit or a whitespace, update appropriate counters. If it is neither of them, update the counter for the special characters. Inform the user about all the counts.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 19:20, mayaparness
Write a program that prompts the user to input a string. the program then uses the function substr to remove all the vowels from the string. for example, if str = "there", then after removing all the vowels, str = "thr". after removing all the vowels, output the string. your program must contain a function to remove all the vowels and a function to determine whether a character is a vowel.
Answers: 2
image
Computers and Technology, 23.06.2019 04:40, Koriunaa
The narrative structure of the popular movies can be broken down into
Answers: 3
image
Computers and Technology, 23.06.2019 20:30, summerhumphries3
What are some settings you can control when formatting columns?
Answers: 1
image
Computers and Technology, 24.06.2019 20:20, isaiahromero15
Write python code that prompts the user to enter his or her favorite color and assigns the user’s input to a variable named color.
Answers: 1
You know the right answer?
Using the For loop Just like the while and the do-while loop, a for loop allows you to repeat your...

Questions in other subjects: