CMPSC121: Intro to Programming Techniques gts Objectives After this lab assignment, students should be able to: • Write functions according to specified prototypes Instructions Define a function named...


CMPSC121: Intro to Programming Techniques gts<br>Objectives<br>After this lab assignment, students should be able to:<br>• Write functions according to specified prototypes<br>Instructions<br>Define a function named reverse that:<br>• Reverses the case of each letter in the first word of a string:<br>o Lowercase letters become uppercase letters<br>o Uppercase letters become lowercase letters<br>• All other characters are left alone<br>• You MUST use the following function prototype: string reverse (string);<br>• HINT: you may use functions from the cetype library: isupper, islower, toupper, and<br>tolower<br>In the main function:<br>• Ask the user to enter a sentence of their choice; the string may contain spaces<br>• Use the reverse function to modify the user's string<br>• Print the modificd string<br>Sample Output<br>Please enter a string below:<br>McGyver premiered in 1985.<br>Your modified string:<br>MCGYVER premiered in 1985.<br>Please enter a string below:<br>Bedford-Stuyvesant, Brooklyn is called Bed-Stuy.<br>Your modified string:<br>ÞEDFORD-STUYVESANT, Brooklyn is called Bed-Stuy.<br>Submission<br>Submit the following file(s) to Canvas before the deadline:<br>1. reverse.cpp<br>

Extracted text: CMPSC121: Intro to Programming Techniques gts Objectives After this lab assignment, students should be able to: • Write functions according to specified prototypes Instructions Define a function named reverse that: • Reverses the case of each letter in the first word of a string: o Lowercase letters become uppercase letters o Uppercase letters become lowercase letters • All other characters are left alone • You MUST use the following function prototype: string reverse (string); • HINT: you may use functions from the cetype library: isupper, islower, toupper, and tolower In the main function: • Ask the user to enter a sentence of their choice; the string may contain spaces • Use the reverse function to modify the user's string • Print the modificd string Sample Output Please enter a string below: McGyver premiered in 1985. Your modified string: MCGYVER premiered in 1985. Please enter a string below: Bedford-Stuyvesant, Brooklyn is called Bed-Stuy. Your modified string: ÞEDFORD-STUYVESANT, Brooklyn is called Bed-Stuy. Submission Submit the following file(s) to Canvas before the deadline: 1. reverse.cpp

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here