Monday
March 27, 2017

Post a New Question

Posted by on .

I'm having some trouble trying to program these problems and putting them into the main function. Please help me by giving some advice or website that offer good information for me.
The questions are below here:
1. Write a function that accepts a string of characters from a user and displays the string one word per line.
2. Write a function that accepts a string of characters, then output all the characters of the string in a reversed order.
3. Write a function that counts the number of words in a string. A word is encountered whenever a transition from a blank space to a non-blank character is encountered. Assume that the string contains only words separated by blank spaces.
4.Write a function that accepts a string from a user and convert all lower case letters to upper case letters and also eliminates all blank spaces in the string.

Write a program that tests all the above functions.

  • C++ programming computer - ,

    1. Use a string function to look for a space in the string, then print the substring between the beginning/last space as a word.
    2. Don't know if there is a string function to do that. If not, read the string backwards, one character at a time and print as you go.
    3. So the blank space is your "delimiter" of words. Locate sequentially all the spaces, and declare it a word if the current space does not follow immediately the preceding one. That is to say, if it is not a zero length word.
    4. You will use the toupper() function, and find a function to delete a substring (blank).

    Post if you have further questions.

  • C++ programming computer - ,

    Write a program that asks the user to enter the student’s name (first and last), and his/her first exam grade of three students, and then display them in a neat format. After that the program will find the average of the three grades, and print it

Answer This Question

First Name:
School Subject:
Answer:

Related Questions

More Related Questions

Post a New Question