hw2-soln - ECE 209 Homework 2 Solution Fall 2007 1. Write...

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

View Full Document Right Arrow Icon
ECE 209 Fall 2007 Homework 2 Solution 1. Write an algorithm in pseudocode that prints the maximum of a sequence of integers. Max = largest negative integer For each integer (i) in sequence: If i > Max, Max = i End loop Print Max 2. Draw a flowchart to describe an algorithm that computes the standard deviation of a sequence of data. The formula for standard deviation is: 2 1 2 1 x x N N i i = = σ where x is the sequence of data, and N is the number of data in the sequence. The symbol x denotes the mean (average) of the sequence x . 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
ECE 209 Fall 2007 Homework 2 Solution 3. The table on the right lists a set of C variables and their values. What is the value of each expression given below? (Make sure to write the value as the correct type. For example, write “2.0” instead of “2” if the expression results in a floating-point value.) Use the table of operators in the textbook, or on the C reference sheet, to determine the precedence and associativity of operators. Expression
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/24/2008 for the course ECE 209 taught by Professor Tuck during the Spring '08 term at N.C. State.

Page1 / 4

hw2-soln - ECE 209 Homework 2 Solution Fall 2007 1. Write...

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

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