Function that accepts a pointer to a c-string

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

Write a function that accepts a pointer to a C-string as an argument and returns the number of words contained in the string. Also have it display the average number of letters in each word.

Your program should have two overloaded function with the following prototype:
int wordCount(char *, double & avg); //returns word number
int wordCount(string, double & avg); //returns word number

Reference no: EM13164642

Questions Cloud

Multiply a set of complex numbers : Write a C program to multiply a set of complex numbers stored in an array (that has been dynamically allocated). Specifically, first prompt the user to enter how many complex numbers need to be multiplied, dynamically create an array to store the ..
Afterwards a way for the user to input : And so on and so forth then afterwards a way for the user to input that they finished a particular task on the list. After the user has input that they have finished a particular task the program should be print "Good Job!" or "Keep it up!"
User enters a list of car parts : So if the user enters a list of car parts, the programm holds this list. Afterward, when the user types in the name of the part the programm outputs that name from the list.
Individual genes are substrings of a genome : Individual genes are substrings of a genome delineated by 3-element start and stop codons. Genes begin with the start codon ATG and end with one of the following 3 stop codons: TAG, TAA or TGA. Note that start codons can appear anywhere in the string..
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. Also have it display the average number of letters in each word.
Write a program that prompts the user to enter the accounts : The program should pass these values to a function that returns the future value of the account after the specified number of months. The program should display the accounts future value.
Create a 1-dimensional (1d) array : Write a program to create a 1-dimensional (1D) array that contains 15 characters and display to the screen a count of the occurrences of each of the vowels a, e, i, o, and u in the array.
. write a segment of code that prints the number of elements : Assuming the array x has been defined as: int x[n]; for some n and that values have been assigned to all the elements. Write a segment of code that prints the number of elements between (but not including) the largest and smallest values in the array..
Function prototypes lack parameters : These function prototypes lack parameters; add whatever parameters you feel are necessary so that the program works without global variables. The program's output should reflect the bus's actions by reporting each change in state, along with the n..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  In c++, write a program that calculates 10,000 tries.

In C++, write a program that calculates 10,000 tries. These tries are based upon a rat trying to escape from a maze. Keep adding minutes until the rat is free and when he is free that is 1 try so we need 10,000. We start by randomly generating a numb..

  Implement recursive algorithms using a stack

Show the difficulties of the added complexity and which of the two sorts is easier to implement nonrecursively? Why?

  Write program which prompts user to enter numbers

Write down the program which prompts the user to enter numbers, findsout how many positive and negative values have been entered, and calculates sum and average of numbers entered.

  Testing a program based on varying

Testing a program based on varying input values without knowing what the code looks like is called _____.With _____ testing, you make sure that every instruction in the code is executed at least once.

  Write a program to crypt its input accordingly

Write a program to crypt its input according to a specified transformation scheme

  Prepare an accounting for a dorm''s kitchen

The "purpose" of the program is to prepare an accounting (database) for e.g. a dorm's kitchen, to keep track of the consumption of beer for each room.

  Write a bouncing ball video game

The balls bounces within the screen where the two horizontal walls are fixed

  Program that initializes a 3x4 array

Write a program that initializes a 3x4 array with test data. It then asks the user for a number input, and checks if the number is present in the array

  Takes a string containing a full name

Write a program that takes a string containing a full name and outputs each part of the name separately with its length. The name should be in the form of first, middle, and last name, separated from each other by a single space. For example, if the ..

  Write a corresponding if else statement

The mathematical operation max(x,y,w,z) can be represented by using the conditional expression operator, as in:  max = (x > y && x > z && x > w) ? x : ((y > z && y > w) ? y : ((z > w) ? z : w))  Write a corresponding if else statement that is equival..

  Write a c program which takes a string from command line

Write a c program which takes a string from command line with mainfunction has no parameter and convert the string in upperca

  Calculation of mortgage interest rates

Instruction of pointers and the calculation of mortgage interest rates.

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