lab5 please submit the lab before you leave please include at a minimum your name, the date, and the...
TRANSCRIPT
Lab5
Please submit the lab before you leave
Please include at a minimum your name, the date, and the lab-program number at the top of the program as a comment.Please also save each file as lab number and your name.
Please submit the zip file of your programs to TA
04/20/23 Lab5 1
Program I
• Create random string and store it in char array. String size is also random.
dasdSfsbfjhjgDyytSfgdfjkujgAhnvbdfhjkhHJHydtbfKJHgfd.The string size is (answer).Press any key to continue.
04/20/23 Lab5 2
Program II
• Create random string and then convert all lowercase letter to uppercase.
dasdSfsbfjhjgDyytSfgdfjkDASDSFSBFJHJGDYYTSFGDFJKPress any key to continue.
04/20/23 Lab5 3
Program III
• Create random string and then count how many the character user input are in the string.
dasdSfsbfjhjgDyytSfgdfjkPlease input a letter: jThere are 3 ‘j’s in the string.Do you want to check more?(y/n): yPlease input a letter: SThere are 2 ‘S’s in the string.Do you want to check more?(y/n): nPress any key to continue.
04/20/23 Lab5 4
(Option) Program IV
• Declare char array and initialize with the sentence, “I am a boy. You are a girl.” (not using scanf) Now the program check if the word user input is in the sentence.
“I am a boy. You are a girl.”Please input a word: boy(enter)Yes, there is “boy” in the sentence.Do you want to check more(y/n)?yPlease input a word: Girl(enter)No, there is no “Girl” in the sentence.Do you want to check more(y/n)?nPress any key to continue.
04/20/23 Lab5 5