Question: Write a function that takes a reference to a string object as its parameter and that converts the contents of the string to uppercase. Use

Write a function that takes a reference to a string object as its parameter and that converts the contents of the string to uppercase. Use the toupper() function described in Table 6.4 of Chapter 6.Write a program that uses a loop which allows you to test the function with different input.A sample run might look like this:

Table 6.4 The cctype Character Functions Function Name Return Value isxdigit ()Enter a string (q to quit): go away
GO AWAY
Next string (q to quit): good grief!
GOOD GRIEF!
Next string (q to quit): q
Bye.

Table 6.4 The cctype Character Functions Function Name Return Value isxdigit () tolower() toupper() This function returns true if the argument is a hexadecimal digit character (that is, 0-9, a-f, or A-F). If the argument is an uppercase character, tolower() returns the lowercase version of that character; otherwise, it returns the argu- ment unaltered. If the argument is a lowercase character, toupper() returns the uppercase version of that character; otherwise, it returns the argu- ment unaltered.

Step by Step Solution

3.29 Rating (170 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

include include include using namespace std void converttouppercasestri... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction Java Program Questions!