Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

*everything is meant to be in C++ produce a library that provides functions for many common manipulations of arrays of strings. For each function you

*everything is meant to be in C++

image text in transcribedimage text in transcribed

produce a library that provides functions for many common manipulations of arrays of strings. For each function you must write, this specification will tell you its interface (what paramet ers it takes, what it returns, and what it must do). It's up to you to decide on the implementation (how it will do it). The source file you turn in must contain all the functions and a main routine. You can have the main routine do whatever you want, because we will rename it to something harmless, never call it, and append our own main routine to your file. Our main routine will thoroughly test your functions. You'll probably want your main routine to do the same. If you wish, you may write functions in addition to those required here. We will not directly call any such additional functions. If you wish, your implementation of a function required here may call other functions required here. The program you turn in must build successfully, and during execution, no function (other than main) may read anything from cin or write anything to cout. All of the functions you must write take at least two parameters: an array of strings, and the number of items the function will consider in the array, starting from the beginning. For example, in: string folks[8] = \{ "samwell", "jon", "margaery", "daenerys", "tyrion", "sansa", "magdalena", "jon" \}; bool b = hasNoCapitals ( folks, 5) ; I/ should return true and not inspect the last three elements of the array.... even though the array has 8 elements, only the first 5 had values we were interested in for this call to the function - the function must not examine any of the others. The one error your function implementations don't have to handle (because they cannot) is when the caller of the function lies and says the array is bigger than it really is. For example in this situation, the function can't possibly know the caller is lying about the number of items in the array: string data[5] = \{ "mamaBbcca", "mamaBbcca", "12,", "98.76", "tyrion" \}; bool b = hasNoCapitals (data, 25 ); // this is bad driver code call /I your implementation doesn't have to check for this, because it can't... To make your life easier, whenever this specification talks about strings being equal or about one string being less than or greater than another, the case of letters matters. This means that you can simply use comparison operators like == or use in C++ to determine true and false. int countFloatingPointValues ( const string array[ ], int n ); Return the number of numerical floating point values found in the passed array or 1 if n. If you don't know what the previous sentence is talking about, you have nothing to worry about. Additionally, your code must not use any global variables which are variables declared outside the scope of your individual functions. Your program must build successfully under both Visual C++ and either clang++ or g++. The correctness of your program must not depend on undefined program behavior. Your program could not, for example, assume anything about t 's value in the following, or even whether or not the program crashes: int main() {strings[3]={"samwell","jon","tyrion"};stringt=s[3];//position3isoutofrange

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Factory Active Database For Enterprise Computing

Authors: Schur, Stephen

1st Edition

0471558443, 9780471558446

Students also viewed these Databases questions