Write a function that accepts a pointer to a c-string

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

Please use C++ programming

Write a function that accepts a pointer to a C-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.

Demonstrate the function in a program that asks the user to input a string or a file.

If the user enters a file, read the file, and submits each sentence to the function.

Write a second function that determines the average length of the words in a sentence.

For each sentence or user-entered phrase, display: the number of words and the average length of the words.

Reference no: EM132100890

Questions Cloud

Determine clients net capital gain or net capital loss : HI6028 Taxation Theory, Practice & Law - How would your answer to (a) differ if Jasmine used the $50,000 to purchase the shares herself, instead of lending it
Calculate the change in momentum : A 10.0g marble slides to the left with a velocity of magnitude 0.400 m/s on the frictionless, horizontal surface of an icy New York sidewalk and has a head-on.
Write a program that asks the user for a password : Write a program that asks the user for a password and verifies that it meets the stated criteria.
What is the tension in the rope : The 1.0 kg block in the figure below is tied to the wall with a rope. It sits on top of the 2.0 kg block. The lower block is pulled to the right with a tension.
Write a function that accepts a pointer to a c-string : Write a function that accepts a pointer to a C-string as an argument and returns the number of words contained in the string.
Write a program that asks the user for the name of a file : Write a program that asks the user for the name of a file. The program shold display the first 10 lines of the file on the screen (the "head" of the file).
What is the mass of the cup : A 100g ice cube at -10 degrees C is placed in an aluminum cup whose initial temperature is 70 degrees C. The system comes to an equilibrium temperature.
Determine how many lines in myloginfile contain string : Create a file called myloginfile that shows all login information on your server since "Aug 24," and then write an awk script.
What would the voltmeter read : A 10.0 uF parallel-plate capacitor is connected to a 12.0 V battery. After the capacitor is fully charged, the battery is disconnected without loss.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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