Write a program that will do the following: • Prompt the user to enter a sentenc
ID: 3635829 • Letter: W
Question
Write a program that will do the following:• Prompt the user to enter a sentence
• Display the number of lowercase, uppercase, and digits in the sentence
• Display the total number of characters
• Display the sentence in all lowercase
• You can assume the sentence would not be longer than 100
• The total number of the characters should not be calculated simply by adding up the other totals.
Example program execution would be
Enter a sentence: “The year is 2011 the month is December and the day is 15.”
Uppercase: 2
Lowercase: 36
Digits: 6
Total: 57
“the year is 2011 the month is december and the day is 15.”
Explanation / Answer
#include //#include #include #include using namespace std; int main(void) { locale loc; string line; getline(cin,line); int upper=0, lower=0, digits=0; for (int i =0; i47 && int(temp)Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.