void WriteArray(int A[], int N); void main() { // open text and drawing windows //Problem 1----------------------------variables and assignment, cout int x = 5, y = 7, z = 9; cout << x << ' ' << y << ' ' << z << endl; x = y + z; y = x + z; z = x + y; cout << x << ' ' << y << ' ' << z << endl; x = z - y; y = z - x; z = y - x; cout << x << ' ' << y << ' ' << z << endl; cout << endl; cout << endl; //Problem 2----------------------------------------integer arithmetic int A = 5, B = 7, C; C = A - B / 3 + A / 2; cout << A << ' ' << B << ' ' << C << endl; C = 10; cout << A++ << ' ' << B++ << ' ' << C++ << endl; cout << A++ << ' ' << B++ << ' ' << C++ << endl; cout << endl; A = 5, B = 7; C = A / (B / A) * B; cout << A << ' ' << B << ' ' << C << endl; cout << endl; //Problem 3-----------------------------------------------------loops //Write a loop with this output: // 6405 * 1601 * 400 * 100 * 25 * 6 * 1 //Problem 4-------------------------------------------------functions // Write a function RectangleArea that has arguments width and height of // type double and returns the area of the rectangle with that width and height. //Problem 5--------------------------------------------------function // Write a function IsOp returns true if and only if its char argument // is '+', '-', '*', or '/'. //Problem 6----------------------------------------------------arrays int AA[8] = { 3, 5, 4, 2, -1, 7, 0, 6 }; for (int J = 0; J < 8; J++) if (AA[J] < 1) AA[J] = 1; WriteArray(AA, 8); for (int J = 0; J < 4; J++) WriteArray(AA, J); } void WriteArray(int A[], int N){ for (int J = 0; J < N; J++) cout << J << ' ' << A[J] << endl; cout << endl; }