
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question

Transcribed Image Text:1- Write a function that takes a word less than 25 characters long and returns the letter that
word starts with (in capital letters).
Frank starts with the letter F.
2- Write a function that has a string as formal parameter. The function then replaces all spaces
and punctuation marks in the string with the asterisk (*). Here is a sample run:
Nothing is impossible, the word itself says 'I'm possible'!
Nothing*is*impossible**the*word*itself*says**I*m*possible**
3- Write a function that takes as input one line and reverses the words of the line.
For example,
birds and bees
Reversed: bees and birds
4- Write a function that takes nouns (a string) as inputs and forms their plurals based on these
rules:
a. If noun ends in "y", remove the "y" and add "ies".
b. If noun ends in "s","ch", or "sh", add "es".
c. In all other cases, just add "s".
(Test on the following: chair dairy boss circus fly dog church clue dish)
chairs dairies bosses circuses flies dogs churches clues dishes
Now create the driver program,
Ask the user for their first and last name. Store the names in separate arrays.
- Greet the user by their full names.
Let them know what their initials are by calling the function in part 1.
Ask them to input their favorite quote. Call function in part 2 to change the quote.
Now call the function in line 3 and have the quote reversed.
Finally, ask them to put in some nouns and pluralize each noun using the function in part
4. Continue evaluating nouns till the user inputs QUIT.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 3 images

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
- Return Something to Me! Write a function that returns the string "something" joined with a space " " and the given argument a. Examples giveMeSomething("is better than nothing") → "something is better than nothing" giveMeSomething ("Bob Jane") → "something Bob Jane" - → "something something" giveMeSomething("something")arrow_forwardMad Libs are activities that have a person provide various words, which are then used to complete a short story in unexpected (and hopefully funny) ways. Write a program that takes a string and an integer as input, and outputs a sentence using the input values as shown in the example below. The program repeats until the input string is quit and disregards the integer input that follows. Ex: If the input is: apples 5 shoes 2 quit 0 the output is: Eating 5 apples a day keeps the doctor away. Eating 2 shoes a day keeps the doctor away.arrow_forwardConsider the following line of code: X = new int*[n]; What should the type of x be? O int O int* O int** O int& O None of the abovearrow_forward
- Return Something to Me! Write a function that returns the string "something" joined with a space " " and the given argument a. Examples giveMeSomething("is better than nothing") → "something is better than nothing" giveMeSomething ("Bob Jane") → "something Bob Jane" - → "something something" giveMeSomething("something")arrow_forwardComplete the rotate_text() function that takes 2 parameters, a string data and an integer n. If n is positive, then the function will shift all the characters in data forward by n positions, with characters at the end of the string being moved to the start of the string. If n is 0 then the text remains the same. For example: rotate_text('abcde', rotate_text('abcde', rotate_text('abcde', 1) would return the string 'eabcd' 3) would return the string 'cdeab' 5) would return the string 'abcde' rotate_text('abcde', 6) would return the string 'eabcd' ... and so on. If n is negative, then the function will shift the characters in data backward by n positions, with characters at the start of the string being moved to the end of the string. For example: rotate text('abcde', -1) would return the string 'bcdea'arrow_forwardWrite a program that removes all spaces from the given input. Ex: If the input is: Hello my name is John. the output is: HellomynameisJohn. Your program must define and call the following function. The function should return a string representing the input string without spaces.string RemoveSpaces(string userString) #include <iostream>#include <algorithm>using namespace std; string removeSpaces(string str) { str.erase(remove(str.begin(), str.end(), ' '), str.end()); return str; } /* Define your function here */ int main() {string str; str = removeSpaces(str); cout << str << endl; /* Type your code here. Your code must call the function. */ return 0;} Please help me with this problem using c++.arrow_forward
- ***python only *** Write a function that takes two parameters, a and b, both are strings taken from "SCISSORS", "PAPER", or "ROCK, and returns True if a wins over b according to the rules of theScissors-Paper-Rock game; False, otherwise. For example, when a is "SCISSORS" and b is "PAPER", the function should return True.arrow_forwardA palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward, disregarding spaces, punctuation, and capitalization. Write a function isPalindrome that takes in a string s and returns a boolean value indicating whether s is a palindrome. Example: Input: s = "racecar" Output: true Input: s = "Hello" Output: false Input: s = "A man, a plan, a canal, Panama" Output: true Input: s = "12321" Output: true Note: The input string may contain spaces, punctuation, and capitalization, but they should be disregarded while checking for palindromes. An empty string is considered a palindrome.arrow_forwardPython IDLE: How would I write a function for the problem in the attached image?arrow_forward
- Need help Writing a function, countVowels, that accepts a string as an argument. countVowels should return the number of vowels in that string. Use recursion. example countVowels('Four score and seven years'); // => 9arrow_forwardQuestion G .Full explain this question and text typing work only We should answer our question within 2 hours takes more time then we will reduce Rating Dont ignore this linearrow_forwardAn 'expression' in programming is... * O any code that performs an operation using a single operator. O any code that is written on a single line. O any code that evaluates to a singular value. any code that calls a function.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- 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

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education