


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



abe lincoln went to the white house
Your function should return the value 12. You may assume that all letters are lower case. Here is the function prototype:
int count_vowels( const vector
a = "abc", b = "abd" a = "cab", b = "cabbage" a = "christine", b = "christopher"
void more_confused( vector
int main() { vector
more_confused( a, b ); a[0] = 7; a[1] = 9; more_confused( b, a );
cout << "3: "; for ( unsigned int i=0; i<a.size(); ++i ) cout << a[i] << " "; cout << endl;
cout << "4: "; for ( unsigned int i=0; i<b.size(); ++i ) cout << b[i] << " "; cout << endl;
return 0; }
-1.3, 5.2, 8.7, -4.5, 0.0, 7.8, -9.1, 3.5, 6.
then the resulting vector of negative numbers should contain:
-1.3, -4.5, -9.
and the resulting vector of positive numbers should contain:
5.2, 8.7, 7.8, 3.5, 6.
Start this problem by writing the function prototype as you think it should appear and then write the code.
p.dominates( r ) r.dominates( q ) q.dominates(r)
should each return false. Write member function dominates. (c) The function dominates v2 should be a non-member function version of dominates. Its behav- ior should be essentially the same as the member function version, so that for the Point objects defined in (b): dominates_v2( p, q )
should return true but the function calls: dominates_v2( p, r ) dominates_v2( r, q ) dominates_v2( q, r)
should each return true. Write dominates v2.
hello now good now no hello first last second won now song xray now silly first
The program should output:
now 3 silly 0 first 1
You should write functions as appropriate to make your program clean and modular.