Write a function that accepts a pointer to a string

Assignment Help C/C++ Programming
Reference no: EM13938384

Create a program containing all the functions below and give your user the ability to choose the function he/she would like to perform. You may want to create a menu for the beginning of the program and use the user's menu selection as the main "driver" for the program. After each execution, the program should clear the screen and return the menu to give the user the
opportunity to play again or exit the program. For example, the following menu numbers represent the following seven functions:
**************************************************************************************
Welcome to my string manipulation program. Select from one of the following menu items:

1. String Length

2. Backward String

3. Word Counter

4. Average Number of Letters

5. Automatic Capitalization

6. Vowel and Consonant Counter

7. Name Arranger

8. Exit Program
*******************--******--***--************************--****--*******
1. Write a function that returns an Integer and accepts a pointer to a string as an argument. The function should count the number of characters in the string and return that number.Demonstrate the function by asking the user to input a string, pass that string to the function, and then display the function's return value.

2. Write a function that accepts a pointer to a string as an argument and displays its contents backwards. For instance, if the string argument is "Gravity", the function should display "ytivarG:.Demonstrate the function by asking the user to input a string and then pass the input to the function. Have the function display the correct return value.

3. Write a function that accepts a pointer to a string as an argument and returns the number of words contained in the string. For instance, if the string argument is "Four score and seven years ago", the function should return the number 6. Ask the user to input a string and then pass the string to the function.

4. Modify the function in part three above so it also displays the average number of letters in each word.

5. Write a function that accepts a pointer to a string as an argument and capitalizes the first character of each sentence in the string. For instance, if the string argument is "hello. my name is Joe. what is your name?", the function should manipulate the string so it contains "Hello. My name is Joe. What is your name?" Ask the user to input a string and then pass the string to the
function. The modified string should be displayed on screen.

6. Write a function that accepts a pointer to a string as an argument and counts the number of vowels appearing in the string. The function should return the number of vowels. Write a second function that accepts the same pointer to the string and returns the number of consonants appearing in the string. If the user selects this menu option, the program should display to the screen BOTH the vowel count AND the consonant count.

7. Write a function that will accept the user's first, middle, and last names. The names should be stored in three different character arrays. The program should then store, in a fourth array, the name arranged in the following manner: the last name followed by a comma and a space, followed by the first name and a space, followed by the middle name. For example, if the user entered "Carol Lynn Smith", it should store "Smith, Carol Lynn" in the fourth array. Display the contents of the fourth arrays on the screen.

Attachment:- cap.zip

Reference no: EM13938384

Questions Cloud

Areas of opportunities for quality improvement : You are a process engineer at ZMD. One of your main responsibilities is to identify areas of opportunities for quality improvement. Recently, you have been researching alternative brands to the primer paint currently used.
What is primes debt-to-equity ratio : Prime Inc. has an after-tax WACC of 10.58% (EAR). The company’s cost of equity is 13.4% (EAR) and its semi-annual coupon bonds have a yield-to-maturity of 7.8% (APR, semi-annually compounded). The tax rate is 35%. What is Prime’s debt-to-equity (D/E)..
Describe current infrastructure-workflow and processes : Review the current state of the infrastructure and focus on a specific area: security, data management, connectivity, etc., and make suggestions for future improvements. Papers must address the following: 1. Clearly describe current infrastructure..
What diols would beproduced from the z and e isomers : The lab manual suggests that KMnO4 can oxidize an alkene into a diol before cleavage of the C-C bond. If the reaction was stopped at the diol stage (as suggested in Chapter 8 of Wade), what diols would beproduced from the Z and E isomers of 2-pentene..
Write a function that accepts a pointer to a string : Write a function that returns an Integer and accepts a pointer to a string as an argument. The function should count the number of characters in the string and return that number.
Power generation for a typical aircraft usage : Task 1: Carry out a detailed comparison between mechanical, fluid and electrical methods of power generation for a typical aircraft usage.
Why are the land and the pump capitalized separately : Prepare journal entries to record depletion for the 11,000 barrels of oil pumped and sold. Is the goodwill amortized? Explain your reasoning. Why are the land and the pump capitalized separately from the oil well?
What is the current value of cars equity and debt : CAR Inc. will be liquidated in one year. The value of CAR’s assets is currently $650 million, and next year it will be either $825 million or $400 million. Before shareholders can be paid next year, CAR will have to repay $500 million of debt. What i..
The greatest mass of ag : According to the equation above, the greatest mass of Ag(s) (molar mass 108 g/mol) that can react with 5.30mL of Br2 (molar mass 160g/mol, density 3.00g/mL) is closest to?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write program to draw rectangle and choose colour of border

Write a program to draw Rectangle and choose Colour of border and fill of the shape using c++.

  Make a function in dr racket

Make a function in Dr Racket that consumes a string and figures out if it starts with a specific letter of the alphabet - Can you help me how should I go about this? Please any ideas?

  What are generic classes in c++

What are generic classes

  Write a program in c++ to read a text file

Write a program in C++ to read a text file (containing more than 500 words), count its alphabets, digits, special characters, capital and small letters, number prepositions and count for each word.

  Write a program that inputs two characters

Write a program that inputs two characters from the keyboard and passes them to function packCharacters.

  Write a statement to call the function

Write an if statement that will assign 7 to p if the variable q is outside the range 100 through 1000. (Use single spaces between operators, operands and statements)

  Create a friend class

Create a Friend class that contains a first name, last name, a birthday, and a telephone number. Create a Contacts class that contains an array of Friend as well as the owner's name and cell phone Number.

  Asignment1questionwrite a recursive function void reverse

assignment1questionwrite a recursive function void reverse that reverse a sentence.for examplesentence greeting new

  Write a program that simulates an airplane race

Program will use a function that has the following parameters: time and acceleration and function will pass back two data items: speed and distance.

  Create a program that asks the user to enter in two numbers

Create a program that asks the user to enter in two numbers. Pass the two numbers as arguments to a function. If the sum of the numbers is greater than 10, the function returns true. Otherwise the function returns false

  Sum of two squares of natural numbers

The formula "x is a sum of two squares of natural numbers" can be written as ?y?z(x = y × y + z × z).

  Search for the value needle in the array

Search for the value needle in the array range given by [hay_begin ... hay_end), using the Linear Search algorithm. This function will return a pointer to the needle value if it is found, or a null pointer if needle is not found.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd