Starting Out with Programming Logic and Design (4th Edition)
4th Edition
ISBN: 9780133985078
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 12, Problem 2AW
Program Plan Intro
Character testing library functions:
- Library functions other than the string library functions are provided by
programming language, which are intended to work with single characters. - The support library functions are used for testing the value of the character.
- The function will return the Boolean result on testing; the result will be in “True” or “False” format.
isUpper(character):
- This function is used to validate whether the character given is upper case letter.
- The function will return “True” if the character is in upper case.
- The function will return “False” if the character is in lower case.
isLower(character):
- This function is used to validate whether the character given is lower case letter.
- The function will return “True” if the character is in lower case.
- The function will return “False” if the character is in upper case.
Example:
The below
//determine if the first character is in lower case
If isLower(str[0]) Then
//replace the values present at the first position
Set str [0] = "0"
//end if
End If
Explanation:
- If condition validates the first position of the “str” is in lower case or not.
- If the condition becomes true, the character at positon “0” gets replaced with the character “0”.
Algorithm:
- Declare and define a string variable “str”.
- Declare and define the required variables for storing index and count of lower case letters.
- Loop that iterates for the entire string.
- Condition to validate whether the given string contains lower case.
- On true add the lower case character count by 1.
- Display the count.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Use String methods to divide the given email into separate parts. The email will always be in this format:
firstName_lastName@domain.com
Pull apart and print the first name, last name, and domain. When printing the values all three should be in proper capitalization format - The first letter of each word is uppercase and the rest are lowercase.
b) Print the given string 8 times along with line number.Print line number first and then the given string. Line number goes from 1-8.
String: "Learning Swift."
WAP in Swift programming language.
Python Program to Remove Punctuations From a String.
Chapter 12 Solutions
Starting Out with Programming Logic and Design (4th Edition)
Ch. 12.2 - Prob. 12.1CPCh. 12.2 - Prob. 12.2CPCh. 12.2 - Design an algorithm that determines whether the...Ch. 12.2 - Design an algorithm that determines whether the...Ch. 12.2 - Prob. 12.5CPCh. 12.2 - Prob. 12.6CPCh. 12 - Prob. 1MCCh. 12 - Prob. 2MCCh. 12 - If the str variable contains the string "berry",...Ch. 12 - If the str variable contains the string "Redmond",...
Ch. 12 - Prob. 5MCCh. 12 - Prob. 1TFCh. 12 - Prob. 2TFCh. 12 - If the String variable str contains the string...Ch. 12 - The insert library module automatically expands...Ch. 12 - Prob. 5TFCh. 12 - Prob. 6TFCh. 12 - Prob. 7TFCh. 12 - Prob. 1SACh. 12 - If the following pseudocode were an actual...Ch. 12 - Prob. 3SACh. 12 - Prob. 4SACh. 12 - Prob. 5SACh. 12 - Design an algorithm that counts the number of...Ch. 12 - Prob. 2AWCh. 12 - Design an algorithm that counts the number of...Ch. 12 - Design an algorithm that deletes the first and...Ch. 12 - Design an algorithm that converts each occurrence...Ch. 12 - Design an algorithm that replaces each occurrence...Ch. 12 - Assume the following declaration exists in a...Ch. 12 - Prob. 1DECh. 12 - Prob. 2DECh. 12 - Prob. 3DECh. 12 - Prob. 1PECh. 12 - Sentence Capitalizer Design a program that prompts...Ch. 12 - Prob. 3PECh. 12 - Sum of Digits in a String Design a program that...Ch. 12 - Prob. 5PECh. 12 - Alphabetic Telephone Number Translator Many...Ch. 12 - Word Separator Design a program that accepts as...Ch. 12 - Pig Latin Design a program that reads a sentence...Ch. 12 - Prob. 9PECh. 12 - File Encryption File encryption is the science of...Ch. 12 - File Decryption Filter Design a program that...
Knowledge Booster
Similar questions
- Python program that accepts a string and calculates the number of digits and letters..arrow_forwardDesign an algorithm or function to find the longest substring which contains 2 unique characters in a given string. You may list steps or psuedo code. Example: In the string "abaacacaacda" return "aacacaac"arrow_forwardVowels and Consonants Design a program that prompts the user to enter a string. The program should then display the number of vowels and the number of consonants in the string. IN Q BASIC LANGUAGEarrow_forward
- An uppercase character is a character whose ASCII value is between 65(A) and 90(Z). Write a C++ program that prompts the user to enter a string from the keyboard and will count the number of uppercase characters and replace each uppercase character by the correspoding lowercase characterarrow_forwardPython method for calculating the length of a String without the use of the len() functionarrow_forward_______ means that one string is appended to another.arrow_forward
- String.ParseInt(m); will convert the integer value of m to a String True Falsearrow_forwardWhen I remove the quotations it says Invalid string a string can have up 2048 charactersarrow_forwardProgramming language is C : (please write with more comments ..thank you) 1- Write a program to accept a string and count the number of vowels present in this string.arrow_forward
- String Concatenation is done this way (Mark all that apply) A.) CONCAT("Hello ", "World!") B.) string str = "Hello " + "World!"; C.) string str = "hello + World";arrow_forwardCreate a flowchart and pseudocode to count the number of characters (character frequency) in a string and displays how many vowels and consonants in the particular string. (Python)arrow_forwardChange a String to uppercase with a tese Write a python program that allows the user to enter a string Change all the characters to uppercase if there at least two uppercase characters in the first 4arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT