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 a program the recursive algorithm for towers of hanoi

Write a program the recursive algorithm for towers of Hanoi. Write a program the iterative algorithm of Towers of Hanoi.

  Linked list in c++

If the following C++ code is valid, show the output. If it is invalid, explain why.

  Computes the final price for a sales transaction

Create a C program that contains a function that computes the final price for a sales transaction and return that value to a calling method.

  What is the line of code doing?

What is the line of code doing?

  Create a main function to test the split function

Create a main function to test the split function, display the string prior to calling the split() function. Display the return value of the split function. Display each element of the vector after the split() function returns.

  Define the following pointer and array

Define the following Pointer and Array. Answer the following question and provide an example: What is the difference between a one-dimensional and a two-dimensional array

  Initialize an array and fill the array with the gpa values.

Write a program in java that asks user input (using a loop) for name of 10 student and the corresponding grade point averages (GPAs). Initialize an array and fill the array with the GPA values.

  Write a function base

Write a function base(b,x) that computes the representation of x in an arbitrary base b.

  Displays columns titled "name", "quantity", "price", value

Write a program that displays columns titled "Name", "Quantity", "Price", and "Value". The fourth column contains the result of multiplying each item's quantity by its price. In addition, the program should calculate and display the total value of th..

  Write down program in c for matrix multiplication program

write down program in c for matrix multiplication. program must accept dimension of both matrices to be multiplied and

  Structure of binary trees to make a family tree

Create a program that uses the structure of binary trees to make a family tree of two generations.

  Use c program language and should work on linuxcomputers

use c program language and should work on linuxcomputers are frequently used in check-writing systems such as payroll

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