Question: in c++ warning: do not use vector to complete this exercise! Write a program that will take N words (separated by white spaces) as input

in c++ in c++ warning: do not use vector to complete this exercise! Write

warning: do not use vector to complete this exercise! Write a program that will take N words (separated by white spaces) as input and return the word that has the most letters. You can safely assume that N is always tess than or equal to 10 , and the word that has the most letters is unique The input starts with an integer indicating the number of words that the user will enter next. You need to use a string array to store these N words. Youmust define a function that takes this string array and the number of words in the array as input and returns the word that has the most letters and its location (le. index) in the array. You function should have the following signature string findLongestWord(string words[ ], int nWords, int \&position); For example if the user enters the following 5 welcome to the Cosc1437 courae and the program will output cosclu37 has the most lettero and ita index in the array is 3 Another example, if the user enters 6. Thio winter ia very very cold the program wil output Winter hap the moat letters and ita index in the array ia i Hint use the length ( ) function to count the number of characters in a string Any attempt to hard code the output will result in 0 for this exercise

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!