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
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?
|