C++ How to Program (10th Edition)
10th Edition
ISBN: 9780134448237
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 13, Problem 13.13E
In some
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
C programming
Write a program that gets a string from the user and removes all characters except letters and numbers from the string. Namely, you will keep 'A'..'Z', 'a'..'z', '0'..'9', but remove the others.
Print the final form of the string.
Example:
If the user enters:
Let Z=X+Y for X=5, Y=10
The output should be:
LetZXYforX5Y10
Q. Hi andre
Write a Java program to check if a given string is a palindrome or not. A palindrome is a word, phrase, number, or other sequence of characters that reads the same backward as forward, ignoring spaces, punctuation, and capitalization.
For example, "racecar" and "Madam" are palindromes, while "hello" and "Java" are not.
Your program should take a string as input and return true if it's a palindrome, and false otherwise.
Ok.
Write a program that prompts the user for a sentence and display in new words.
Your program should behave as follow:
1. Display a welcome message.
2. Ask the user for prompting a string with 3 words and 1 punctuation without any spaces.
3. Display the length of the string sentence.
4. Separate the words in the phrase
a. Prompt user for the length of each word
b. Display the complete sentence with the punctuation in the end.
5. Display a farewell message, so that the user knows that the program has terminated
normally.
Restrictions: No looping statements allowed (or needed). This question requires the use of the
functions: length(), substr() to generate the complete sentence.
Following are the sample screen shots to illustrate the expected behavior of your program. User
input at the keyboard is marked with a red circle. Your program should work with any sentence with
3 words entered by the user. Assume a perfect user who will always enter correct info.
Note: Your program must display…
Chapter 13 Solutions
C++ How to Program (10th Edition)
Ch. 13 - (Write C ++ statements) Write a statement for each...Ch. 13 - (Inputting Decimal, Octal and Hexadecimal Values)...Ch. 13 - Prob. 13.8ECh. 13 - (Printing with field Widths) Write a program to...Ch. 13 - (Rounding) Write a program that prints the value...Ch. 13 - (Length of a String) Write a program that inputs a...Ch. 13 - (Converting Fahrenheit to Celsius) Write a program...Ch. 13 - In some programming language, string are entered...Ch. 13 - Prob. 13.14ECh. 13 - Prob. 13.15E
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- C Language - Write a program that takes a date as input and outputs the date's season in the northern hemisphere. The input is a string to represent the month and an int to represent the day.arrow_forwarda. Write a program that reads your id and full name and display. And also display the index of first letter and last letter of your full name. b. Modify above program, Declare a string course, let your program read course from user, check if course is not equal to comp2002, clear the string otherwise concatenate course and " Computer Science Department". C. Modify above program declare a string college="". If string college is empty then assign a new string "College of Science".arrow_forwardTake input a string s from the user and print the number of characters less than 's' in the string. String may contain any character. Programming Language- Javaarrow_forward
- In Python Write a program that allows the user to type in a phrase and then outputs the acronym for that phrase. Note: The acronym should be all uppercase, even if the words in the phrase are not capitalized.arrow_forward7bact1 Please help me answer this in python programming.arrow_forwardA string literal in Python must be enclosed ina. parentheses.b. single-quotes.c. double-quotes.d. either single-quotes or double-quotes.arrow_forward
- Exercise 1: Ask the user to type a string. Count and display the number of vowels (a,e,i,o,u). Print the string with all the vowels removed. Exercise 2: Cows cost $10 each, sheep cost $1 each and 8 hens can be bought for $1. Write a program which will buy exactly 100 animals for exactly $100 containing all three types (not just 100 sheep!)arrow_forwardwrite a program that prompts the user to input a string. then the program uses the function substr to remove all the vo0wels from the stringarrow_forwardExercise 1: A palindrome is a string of characters that reads the same for- wards as backwards. For example, the following are both palindromes: 1457887541 madam Write a program that prompts the user to input a string of a size 50 characters or less. Your program should then determine whether or not the entered string is a palindrome. A message should be displayed to the user informing them whether or not their string is a palindrome.arrow_forward
- Write a code that determines if a string is a palindrome (can be read forward and backward with the same meaning); e.g. "civic", “elle", “madam" 66 22arrow_forwardA string is a palindrome if it reads the same from front to back as it does from back to front (e.g. "kayak", "rotator" and "noon" are palindromes). When determining whether an alphanumeric string is a palindrome, we often ignore spaces, punctuation and case in the string (e.g. "A man, a plan, a canal --Panama!" is also considered a palindrome). Write a complete C program to read a string, echo it to the screen, determine whether it is a palindrome, and write a message indicating whether it is or isn't. Your main function should prompt for the string, read the string, print it, call the clean function (to remove all spaces, punctuation, and turn uppercase letters into lowercase letters), print the new string, then call the reverse function (to place the characters into reverse order) and print the new string resulting. In the final step, you will compare the result of the reverse function with the original string and print a message if the string is a palindrome or not. The clean…arrow_forwardWhich of the following statements is/are correct? I. The language L accepts all the strings of a's and b's where the third symbol from left end is b. The regular expression for L is (a + b) b(a + b)*. II. The language L accepts all the strings of a's and b's where the number of a's in a string is divisible by 3. The regular expression for L is (b* ab* ab* ab* )*. III. The regular expression R=(a+b)“ . The number of states required to construct the minimal DFA for the regular expression R is n+2. (A) I and II (B) I and III (C) II and III (D) All are correctarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Constants, Variables, Data types, Keywords in C Programming Language Tutorial; Author: LearningLad;https://www.youtube.com/watch?v=d7tdL-ZEWdE;License: Standard YouTube License, CC-BY