Exercise 11 1. Write a program that accepts two input strings. Then check length of the strings. • If they are the same
Posted: Sat May 14, 2022 3:44 pm
Exercise 11 1. Write a program that accepts two input strings. Then check length of the strings. • If they are the same length, type "Same". • But if not equal, check which one is longer? Display a longer message. 2. Write a program to get 1 sentence, store it in variable s, and count the number of uppercase and lowercase letters. Input: S: String type data to store a single text sentence. Output Number of words in a sentence. Each word in a sentence is separated by a space. • Number of uppercase letters in a sentence. Number of lowercase letters in a sentence. Example Run #1 > Enter a sentence: Nearly 1 million kids ages 5 to 10 expected to receive first Covid vaccine dose by end of Wednesday. > Words: 19 > Uppercases: 3 > Lowercases: 74 Example Run #2 >Enter a sentence: NEARLY 1 MILLION KIDS AGES 5 to 10 EXPECTED to RECEIVE FIRST COVID VACCINE DOES by END of WEDNESDAY Words: 19 Uppercases: 69 Lowercases: 8