Practice Test Problems

These are practice test problems. I don't know how to do them. Any links to websites to help me out would be appreciated. Thanks!
1
2
3
1. void output( unsigned howMany );
Function's job is to output howMany prime #'s, starting with 2, taking every other prime #. For example, output( 6 ) will output
2  5  11  17  23  31


1
2
2. void readE( double & max, double & min, double & average );
(On entry, all 3 args are garbage.)


1
2
3
4
5
6
7
3. void secretCode( string & s );
On entry, s is a non-encrypted message.
secretCode's job is to change each character of s as follows:
Each lower case letter in ['a', 'j']: replace with digit in ['0','9'];
Each digit in ['0','9']: replace with upper case letter in ['A', 'J'];
Each upper case letter in ['A', 'J']: replace with lower case letter in ['a', 'j']
all other 226 chars: leave unchanged. 


1
2
3
4
5
6
4. void showPrimes();
showPrimes declares array of 100 unsigneds.
showPrimes calls prime to fill the array with the first 100 prime numbers.
showPrimes() calls
        void outputArray( const unsigned array[], unsigned els );
to output all 100 prime numbers.
Last edited on
http://www.cplusplus.com/forum/articles/1295/

It is OK to ask for hints, but not for entire solutions.
I edited. Any links would be appreciated. Thanks!
Topic archived. No new replies allowed.