// Test program for if-else statements from Lab 4. // Place your code segments where indicated and then // test your code using the test values you selected. // If the variables do not have the values you predicted, // try to find the error. #include void main () { int i,j; // Integers for testing program segments char More; // Y indicates that more testing is needed // ********************************************** // Segment a: Get values for i and j from user do { cout << endl << "Segment a" << endl << endl; cout << "Enter a value for i: " << flush; cin >> i; cout << "Enter a value for j: " << flush; cin >> j; // Place your code for Segment a here. cout << "i = " << i << endl; cout << "j = " << j << endl << endl; cout << "More Testing? " << flush; cin >> More; } while (More == 'Y'); // ********************************************* // Segment b do { cout << endl << "Segment b" << endl << endl; cout << "Enter a value for i: " << flush; cin >> i; cout << "Enter a value for j: " << flush; cin >> j; // Place your code for Segment b here. cout << "i = " << i << endl; cout << "j = " << j << endl << endl; cout << "More testing? " << flush; cin >> More; } while (More == 'Y'); // *********************************************** // Segment c do { cout << endl << "Segment c" << endl << endl; cout << "Enter a value for i: " << flush; cin >> i; cout << "Enter a value for j: " << flush; cin >> j; // Place your code for Segment c here. cout << "i = " << i << endl; cout << "j = " << j << endl << endl; cout << "More testing? " << flush; cin >> More; } while (More == 'Y'); }