# Lab2 - Thomas Nanke CIS 200-001 CIS 200L-001 Lab #2...

This preview shows pages 1–3. Sign up to view the full content.

Thomas Nanke CIS 200-001 CIS 200L-001 Lab #2 Creating and Testing an Odd Function 1/23/08

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2. Problem Statement Student Name: Thomas Nanke Note: In order to complete the following one assignment, you need to create your own main() to test the correctness of your functions. Question 1 Given that A[MAX_ROWS][MAX_COLUMNS] is a 2 dimensional array of integers, write a C++ function Odd to find the total number of odd elements in the array. It should have 3 input parameters A[ length ][ width ], length and width . The function should return an integer. The constants MAX_ROWS and NUM_DE MAX_COLUMNS may be accessed globally by defining the following global variables: #define MAX_ROWS 3 #define MAX_COLUMNS 2 The array A is initialized by the following statement in your main(): int A[MAX_ROWS][ MAX_COLUMNS] = { {3 , 2}, {4, 5}, {2, 2} }; 3. Lab status listing any problems and what is required to fix the problem(s) The problem was to create a function called Odd that counts how many odd numbers there are in a given two-dimensional array. To solve this problem, I implemented the use
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 04/25/2010 for the course CECS CIS 200 taught by Professor Jieshen during the Winter '08 term at University of Michigan-Dearborn.

### Page1 / 4

Lab2 - Thomas Nanke CIS 200-001 CIS 200L-001 Lab #2...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online