Question: Please write it in C++ Important requirements for all questions: No global variable is allowed to be declared and used. Constants are ok. Functions cannot

Please write it in C++
Important requirements for all questions:
No global variable is allowed to be declared and used. Constants are ok.
Functions cannot use cin or cout unless it is explicitly permitted. It should
make use of parameters and return value instead. cin and cout should be done
in main() or any testing functions
Multiple return statements in one function are not allowed.
The function cannot use the string class or string functions such as strlen. It
should only manipulate C-string as an array of chars with NULL at the end.
Please clearly show how you test your functions with at least the provided test
data
 Please write it in C++ Important requirements for all questions: No

Write a function named "isJustZeroAndOnes" that accepts a C-string (an array of characters terminating by a NULL character). It returns true when the C-string just contains ' 0 's and/or ' 1 's only and false otherwise. In addition, it also returns two additional boolean flags: one flag to indicate the C-string contains only ' 0 's and the other to indicate that it contains only 'I's. In another words, this function will return 3 different boolean flags. For example, these are the C-strings with their expected return values: Write a function named "isJustZeroAndOnes" that accepts a C-string (an array of characters terminating by a NULL character). It returns true when the C-string just contains ' 0 's and/or ' 1 's only and false otherwise. In addition, it also returns two additional boolean flags: one flag to indicate the C-string contains only ' 0 's and the other to indicate that it contains only 'I's. In another words, this function will return 3 different boolean flags. For example, these are the C-strings with their expected return values

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!