// // Filename: pgm4_1a.cpp // // Description: Arrays #1 // // ENSC 104: Digital Computer Programming // // Instructor: Dr. Walsh // // Section: 2 // // Date Created: 03/28/98 // Last Modified: 03/28/98 // // Name: N/A // #include #include #include const int NUM_ELEMENTS = 10; main() { char c_array[NUM_ELEMENTS]; int i_array[NUM_ELEMENTS]; int int_min; int int_max; int int_range; double d_array[NUM_ELEMENTS]; double d_min; double d_max; double d_range; srand( time( NULL ) ); // // The following block of code randomly generates lower case // lettes of the alphabet. Note from page 889 in your text, the // ASCII table, the ASCII codes for the characters are 97 to 122. // The following code randonly generates an integer between 97 // and 122 and type casts it to a char. // cout << "\n\n***** Randomly Generating Characters *****\n\n"; for( int i=0; i> int_min; cout << "\tEnter the maximum integer value: "; cin >> int_max; cout << endl; int_range = int_max - int_min; for( i=0; i> d_min; cout << "\tEnter the maximum double value: "; cin >> d_max; cout << endl; d_range = d_max - d_min; int_min = d_min * 1000; int_max = d_max * 1000; int_range = int_max - int_min; for( i=0; i