just for the sake of it, on the first one...
Code:
#includes...

void main() {
char repeat_program ;
for( ;; ) {           //forever

 .        .        .
do {
        cout << "Want to repeat this?\n" ;
        cin >> repeat_program ;
        repeat_program = toupper( repeat_program ) ;   //since we are including iomanip
        if( repeat_program == 'Y' ) break ;
} while( repeat_program != 'N' ) ;
// force selection of 'y' or 'n'
}