homework7-solns

homework7-solns - Assigned: 03/05/2007 Due: 03/19/2007 CprE...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Assigned: 03/05/2007 Due: 03/19/2007 1 CprE 211 – Spring 2007 Homework 7 Name: Lab section #: Email address: NOTE: Homework answers must be typed using a word editor. Handwritten answers will not be accepted. The homework is due in the class on the due date; submit a hard copy in the class. You are allowed to discuss homework but you are not allowed to exchange answers or submit duplicate work. Late homework should be submitted by e-mail to the instructor ( [email protected] ).You can turn in homework late with a 10% per day (week day or weekend) until the solutions are published. Among all of your homework submissions, the one with the lowest score will be excluded in the calculation of your overall grade. Your program should come with the font type “Courier New” and with proper formatting and comments. A program with a bad style may receive up to 20% penalty. 1. [20] Consider the following C program: //////////////////////////////////////////////////////////////// // short MaxOfNibbles(char *arr, short numElements) // description: Returns a short value that is the maximum of the // lower nibble values in the array for array elements in which // bit 7 is set to 1. // PARAMS: // char *arr: char array in which to find the maximum // lower nibbles // short numElements: number of elements in the char array // RETURNS: // returns the maximum of lower nibble values for which // bit 7 = 1 char MaxOfNibbles(char arr[] , short numElements) { //short var to store the summation of lower nibble values char maxLowNib = 0; int i; // walk through the array, find the maximum nibble value
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/02/2008 for the course CPR E 211 taught by Professor Wang during the Spring '06 term at Iowa State.

Page1 / 5

homework7-solns - Assigned: 03/05/2007 Due: 03/19/2007 CprE...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online