Concept explainers
toupper:
The lowercase letter will be converted by uppercase letter using “toupper” function.
Example:
Consider the example of “toupper” is as follows:
//declare the variable
char c;
//convert equivalent lowercase letter
c = toupper ('x');
//display the output
cout << c;
Here, the “toupper” function is used to convert the given character into uppercase letter.
tolower:
The uppercase letter will be converted by lowercase letter using “tolower” function.
Example:
Consider the example of “tolower” is as follows:
//declare the variable
char c;
//convert equivalent lowercase letter
c = tolower ('X');
//display the output
cout << c;
Here, the “tolower” function is used to convert the given character into lowercase letter.
Want to see the full answer?
Check out a sample textbook solutionChapter 10 Solutions
Starting Out with C++ from Control Structures to Objects (8th Edition)
- Assume the following variables are defined: char ch; double interest ; string name ; Assign each variable to a value of the correct data type.arrow_forwardFill-in-the-Blank When used as parameters, _________ variables allow a function to access the parameter’s original argument.arrow_forward2. What data type would you use to allow a function to receive an Int or nil value as its parameter? func display(num: ____ ) { if num == nil { print("Not a number") } else { print(num) } } display(num: 5) display(num: nil)arrow_forward
- The ________ function returns no value. a) malloc() b) realloc() c) free() d) calloc()arrow_forwardC++arrow_forwardFollowing code in C using random Name Reg no and highschool name Use switch case in C language to do the following: Create a restaurant with the name “Your Name - Reg_No – Name of your highschool” The restaurant should come with the options of delivery and take away and the choice should be displayed as “Delivery – Registration No” and “Takeaway – Name” Each option should have the same menu and an extra 15% charge be included if a customer wants home delivery Both menus should have two items that are customizable, such as a burger can have chillies removed, cheese added and extra mayonnaise. The user should have the option of choosing multiple items with multiple quantity. Print a bill in the end.arrow_forward
- C programringarrow_forwardCode is here- def validate_name(passed_name): '''This function is used to validate the first and last name''' valid = False valid_chars = ['"', '\''] for character in passed_name: if character.isalpha() or character.isspace() and character in valid_chars: valid = True else: valid = False break return valid def validate_company(passed_model): '''This function is used to test the company name''' bad_chars = ['"'] if passed_model: for character in passed_model: if character in bad_chars: print("Company name is incorrect. Please try again. ") return False return True else: print("Please try again.") return False def validate_address(passed_model): '''This function is used to validate the vehicle model''' bad_chars = [ "!", '"', "@", "$", "%", "^", "$", "*", "_", "=", "+", "<", ">", "?", ";", "[", "]", "{", "}"] if passed_model: for character in passed_model: if character in bad_chars: print("Address is incorrect. Please try again.") return False return True else:…arrow_forwardNonearrow_forward
- # Question 4def costume_rating(costume_color, bling_value): """ Returns a function that calculates the number of candies to return based on the costume color, bling value, and phrase length. Args: costume_color (str): The color of your costume. Must be one of 'blue', 'red', 'green', 'yellow', 'purple', or 'orange'. bling_value (int): Represents how shiny your costume is. Must be a positive integer. Returns: A function that takes in one parameter: phrase (str): The phrase said by the trick-or-treater. >>> costume_rater = costume_rating('blue', 5) >>> costume_rater('19 Character Phrase') 85 >>> costume_rater('e') 0 >>> costume_rater('seven c') 1 >>> costume_rater = costume_rating('orange', 8) >>> costume_rater('hello i want candy') 14 >>> costume_rater = costume_rating('yellow', 5) >>> costume_rater('please give me…arrow_forwardQ5: In C programming, "Char" and "int" data types are used. They represent certain number of bits. Please fill in the blanks for following data types assuming that that the code is running on 32 bit machine. Data type Total number of bits/bytes int chararrow_forwardIn C++arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education