STARTING OUT WITH C++FROM CONTROL STRU
STARTING OUT WITH C++FROM CONTROL STRU
18th Edition
ISBN: 9781323815458
Author: GADDIS
Publisher: PEARSON
Question
Book Icon
Chapter 10, Problem 11PC
Program Plan Intro

Case Manipulator

Program plan:

  • Include the required header files to the program.
  • Declare the constant variable.
  • Declare function prototypes which are used in the program.
  • Define the “main()” function.
    • Declare the required variables.
    • Get the input C-string from the user.
    • Copy the string 1 to string 2 and string 3.
    • Call the “upper” function and display the result.
    • Call the “lower” function and display the result.
    • Call the “reserve” function and display the result.
  • Define the “upper” function.
    • Check the string not equal to zero.
      • If the letter is not an uppercase, change the letters into uppercase using “toupper” function.
  • Define the “lower” function.
    • Check the string not equal to zero.
      • If the letter is not a lowercase, change the letters into lowercase using “tolower” function.
  • Define the “reverse” function.
    • Check the string not equal to zero.
      • If the letter is not an uppercase, change the letters into uppercase using “toupper” function.
      • Otherwise, if the letter is not a lowercase, change the letters into lowercase using “tolower” function.

Blurred answer
Students have asked these similar questions
In C++, Write a function that receives a string of characters and return true if the string is in language, otherwise it returns false. You may use following function header (Assume a string is in language if it is read from the left side is the same as it is read from the right side. For example, a-b-d-c is not in the language, a-b-c-a-c-b-a is in language): bool isInLanguage_2(string aString) And I also, want to know if my if statement is incorrect, and if it is how is it incorrect?
C++ Code: DNA Sequence  The main() function is already written for you. You will implement the function int numOccurrences(string& STR, string& sequence). Without even understanding what functions do in C++, all you need to know, at this point, is that you have access to the string STR of which you have to find the length of the largest consecutive occurrence in the string sequence. For example, if input sequence is: AGACGGGTTACCATGACTATCTATCTATCTATCTATCTATCTATCTATCACGTACGTACGTATCGAGATAGATAGATAGATAGATCCTCGACTTCGATCGCAATGAATGCCAATAGACAAAA then numOccurrences("AGAT", sequence) should return 5 numOccurrences("TATC", sequence) should return 8 if input sequence is: AACCCTGCGCGCGCGCGATCTATCTATCTATCTATCCAGCATTAGCTAGCATCAAGATAGATAGATGAATTTCGAAATGAATGAATGAATGAATGAATGAATG then numOccurrences("AATG", sequence) should return 7 numOccurrences("TATC", sequence) should return 4 if input sequence is:…
String Manipulation  In this question, you will be implementing the following functions int findChar(char * str, char c); Searches for the character c in the string str and returns the index of the character in the string. If the character does not exist, returns -1 int replaceChar(char * str, char c1, char c2); Searches for the character c1 in the string str and if found, replace it with c2.The function returns the number of replacements it has performed. If the character does not exist, returns 0. int removeChar(char * str1, char * str2, char c); Creates a copy of str1 into str2 except for the character c that should be replaced with ‘*’ For example, if str1=”Hello World” and c=’l’ then the function should make str2=”He**o Wor*d” int isPalindrome(char * str) Checks to see if a string is Palindrome(reversible). If it is, returns 1, otherwise returns 0. A palindrome string reads similarly from left to right and from right to left like madam, level, radar, etc. int reverseString(char…

Chapter 10 Solutions

STARTING OUT WITH C++FROM CONTROL STRU

Ch. 10.5 - Write a short description of each of the following...Ch. 10.5 - Write a statement that will convert the string 10...Ch. 10.5 - Prob. 10.13CPCh. 10.5 - Write a statement that will convert the string...Ch. 10.5 - Write a statement that will convert the integer...Ch. 10.6 - Prob. 10.16CPCh. 10 - Prob. 1RQECh. 10 - Prob. 2RQECh. 10 - Prob. 3RQECh. 10 - Prob. 4RQECh. 10 - Prob. 5RQECh. 10 - Prob. 6RQECh. 10 - Prob. 7RQECh. 10 - Prob. 8RQECh. 10 - Prob. 9RQECh. 10 - Prob. 10RQECh. 10 - The __________ function returns true if the...Ch. 10 - Prob. 12RQECh. 10 - Prob. 13RQECh. 10 - The __________ function returns the lowercase...Ch. 10 - The _________ file must be included in a program...Ch. 10 - Prob. 16RQECh. 10 - Prob. 17RQECh. 10 - Prob. 18RQECh. 10 - Prob. 19RQECh. 10 - Prob. 20RQECh. 10 - Prob. 21RQECh. 10 - Prob. 22RQECh. 10 - Prob. 23RQECh. 10 - Prob. 24RQECh. 10 - The ________ function returns the value of a...Ch. 10 - Prob. 26RQECh. 10 - The following if statement determines whether...Ch. 10 - Assume input is a char array holding a C-string....Ch. 10 - Look at the following array definition: char...Ch. 10 - Prob. 30RQECh. 10 - Write a function that accepts a pointer to a...Ch. 10 - Prob. 32RQECh. 10 - Prob. 33RQECh. 10 - T F If touppers argument is already uppercase, it...Ch. 10 - T F If tolowers argument is already lowercase, it...Ch. 10 - T F The strlen function returns the size of the...Ch. 10 - Prob. 37RQECh. 10 - T F C-string-handling functions accept as...Ch. 10 - T F The strcat function checks to make sure the...Ch. 10 - Prob. 40RQECh. 10 - T F The strcpy function performs no bounds...Ch. 10 - T F There is no difference between 847 and 847.Ch. 10 - Prob. 43RQECh. 10 - char numeric[5]; int x = 123; numeri c = atoi(x);Ch. 10 - char string1[] = "Billy"; char string2[] = " Bob...Ch. 10 - Prob. 46RQECh. 10 - Prob. 1PCCh. 10 - Prob. 2PCCh. 10 - Prob. 3PCCh. 10 - Average Number of Letters Modify the program you...Ch. 10 - Prob. 5PCCh. 10 - Prob. 6PCCh. 10 - Name Arranger Write a program that asks for the...Ch. 10 - Prob. 8PCCh. 10 - Prob. 9PCCh. 10 - Prob. 10PCCh. 10 - Prob. 11PCCh. 10 - Password Verifier Imagine you are developing a...Ch. 10 - Prob. 13PCCh. 10 - Word Separator Write a program that accepts as...Ch. 10 - Character Analysis If you have downloaded this...Ch. 10 - Prob. 16PCCh. 10 - Prob. 17PCCh. 10 - Prob. 18PCCh. 10 - Check Writer Write a program that displays a...
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning