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 cach letter in the first word of a string: o Lowercase letters become uppercase letters o Uppercase letters become lowercase letters o All other characters are left alone • You MUST use the following function prototype: string reverse (string); • HINT: you may use functions from the cet ype library: i supper, islower, toup 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 modified 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
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 cach letter in the first word of a string: o Lowercase letters become uppercase letters o Uppercase letters become lowercase letters o All other characters are left alone • You MUST use the following function prototype: string reverse (string); • HINT: you may use functions from the cet ype library: i supper, islower, toup 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 modified 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
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question

Transcribed Image 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
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images

Recommended textbooks for you

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY