Write a function that takes a reference to a string object as its parameter and that converts
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 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:
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.
Transcribed Image Text:
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.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 50% (12 reviews)
include include include using namespace std void converttouppercasestri...View the full answer
Answered By
Aketch Cindy Sunday
I am a certified tutor with over two years of experience tutoring . I have a passion for helping students learn and grow, and I firmly believe that every student has the potential to be successful. I have a wide range of experience working with students of all ages and abilities, and I am confident that I can help students succeed in school.
I have experience working with students who have a wide range of abilities. I have also worked with gifted and talented students, and I am familiar with a variety of enrichment and acceleration strategies.
I am a patient and supportive tutor who is dedicated to helping my students reach their full potential. Thank you for your time and consideration.
0.00
0 Reviews
10+ Question Solved
Related Book For
Question Posted:
Students also viewed these Computer science questions
-
When the vibrations of a string are damped, with a resistance which is proportionnal to the velocity. the one dimmensional wave equation becomes Pu t Ju t 01 where is the constant of proportionality...
-
Write a function that takes an input file stream object and a 2d array as parameters and reads all the characters in the input file stream, incrementing the count in the 2d array for each letter found
-
Your task: You are asked to write a function that applies Simulated Annealing to a Traveling Salesman Problem. That is, your function will run simulated annealing as discussed in class and report...
-
Adam and Mandeep are in a partnership in retailing computer accessories. The partnership records, exclusive of GST, for this income year, disclose: Receipts ($): 530,000 Payments ($): 175,000 70,000...
-
In 2010, the Dodd-Frank Act authorized the Federal Reserve, Financial Services Oversight Council, and Office of Credit Ratings to issue new financial regulations, including stronger capital...
-
Sanchez Co. enters into a contract to sell Product A and Product B on January 2, 2020, for an upfront cash payment of $150,000. Product A will be delivered in two years (January 2, 2022) and Product...
-
Discuss four ways that the internet has affected selling and sales management practices.
-
Suppose that on June 1, Rockin Gyrations, a disc jockey service, creates a petty cash fund with an imprest balance of $500. During June, Michael Martell, fund custodian, signs the following petty...
-
A boat has a velocity of 4.0 m/s [E] in still water. It is in a river of width 150 m, that has a river velocity of 3 m/s [N]. a) What is the velocity of the boat relative to the shore? b) How far...
-
The City Council of the City of Eastover adopted the following budget for its General Fund for 20X8. The budget was not revised during the fiscal year. The budgetary basis was modified accrual. City...
-
The CandyBar structure contains three members. The first member holds the brand name of a candy bar. The second member holds the weight (which may have a fractional part) of the candy bar, and the...
-
Suppose the song() function has this prototype: void song(const char * name, int times); a. How would you modify the prototype so that the default value for times is 1? b. What changes would you make...
-
Go to the IMF website at www.imf.org and find the World Economic Outlook database; then download data on the current account balance (as a percent of GDP) for Greece, Spain, Portugal, Italy, and...
-
Jackson Corp. had a 2020 NOL of $400,000. Additionally, Jackson had a capital loss of $45,000 from 2021 and had no capital gains prior to 2023. The company's taxable income in 2023 is $300,000, which...
-
How does Motivator - Hygiene theory apply to your workplace? Provide an example and include an explanation of the model.
-
Last month when Holiday Creations, Incorporated, sold 5 0 , 0 0 0 units, its sales, variable expenses, and fixed expenses were $ 2 0 0 , 0 0 0 , $ 1 2 0 , 0 0 0 , and $ 6 5 , 0 0 0 , respectively....
-
G is employed by a Canadian - controlled private corporation. In year 1 , G was granted a stock option to acquire 4 , 0 0 0 shares from the treasury of his employer s corporation for $ 7 a share. At...
-
Lime company purchased 4 0 0 units for $ 2 0 each on January 3 1 . It purchased 8 5 units for $ 3 0 each on February 2 8 . It sold 1 5 0 units for $ 4 5 each from March 1 through December 3 1 . If...
-
A heat engine takes in 125 kJ of heat from a reservoir at 815 K and exhausts 82 kJ to a reservoir at 293 K. (a) What is the efficiency of the engine? (b) What is the efficiency of an ideal engine...
-
In Problems, solve each system of equations. x + 2y + 3z = 5 y + 11z = 21 5y + 9z = 13
-
Draw contour diagrams to show the state of execution prior to the following line numbers of the CalcAreaCircle class in Fig. 2.35 in Sect. 2.11. A. Line 8 B. Line 12 (assume an input value of 2.0 )...
-
Indicate whether the following statements using the Circle class in Fig. 2.34 in Sect. 2.11 are syntactically correct or incorrect. If incorrect, indicate what is wrong with the statement: *A. Circle...
-
Rewrite the complete program in Sect. 1.10 using dialog boxes for input and output. Input ? Message Enter the number: 4.0 OK Cancel Two to the power of 4.0 is 16.0. OK X X
-
Drilling Company uses activity-based costing and provides this information: Driver Rate Manufacturing Activity Cost Driver Materials handling Number of parts $ 0.60 Machinery Number of machine hours...
-
You are hoping to implement a project to distribute free fertilizer to farmers. In the current year (year 0), there will be an upfront administrative cost of $200 of setting up the program. Then,...
-
A owns ABC, Inc., an S corporation. A's stock basis was $10,000 at the beginning of year 1 and he loaned ABC $3,000 on Jan. 1. ABC has loss of $15,000 for the year. 30. How much of the loss can A...
Study smarter with the SolutionInn App