lecture02-introC

lecture02-introC - EE312 SOFTWARE DESIGN AND IMPLEMENTATION...

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

View Full Document Right Arrow Icon
EE312: SOFTWARE DESIGN AND IMPLEMENTATION I LECTURE 2: INTRODUCTION TO C Spring 2012 Professor Suzanne Barber [email protected] ACES 5.440 Office Hours: MW 11 am – Noon, or by appointment
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 !!"#$ & '()*+,( $ -. ./+.)(0(.*1 ! -1123.0(.* # 21 4/1*(5 /. 667 !"# %#!&#'!() *(&"(+) ,- .#/0+# 12!&2345 ! 8/42)1 9/, */5:; <2== :.1<(, *>( ?+(1@/.1A ! B/,( /. <>:* 21 4,/3,:002.3C ! D>:* 21 *>( ,(=:@/.1>24 /9 >23> =(E(= =:.3+:3(1 */ *>( E/. F(+0:. . )/04+*(, C ! D>:* 21 *>( G 4,/3,:002.3 =:.3+:3( C ! D>:* 21 G 1;.*:H C
Background image of page 2
!"#$%&' )#%*+,- Problem Design Program
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 ./01/ 2304 05 678907:; ! You have 27 coins, one of which is heavier than all of the others (which all weigh the same). ! You have one scale. ! How can you find the heavier coin in just three weightings?
Background image of page 4
5 <4 <=>3:0?/@ 1. Divide the coins into three groups of nine 2. Compare any two groups a. If they don ` t balance, select the heavier group b. If they do balance, select the group you didn ` t weigh 3. Divide the heavier group (of nine coins) into three groups of three 4. Compare any two groups a. If they don ` t balance, select the heavier group b. If they do balance, select the group you didn ` t weigh 5. Divide the heavier group (of three coins) into three groups of one 6. Compare any two groups a. If they don ` t balance, you ` ve found the heavier coin b. If they do balance, the heavier coin is the one you didn ` t weigh
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 -0904> 2=78: +45?:A1?0345 ! Can YOU follow clear instructions? ! If you can ` t, how can you expect a computer to? ! Can you GIVE clear instructions? ! If you can ` t, how can you expect to write a program?
Background image of page 6
7 Errors are expensive. 0 10 20 30 40 50 60 70 80 90 100 Design Coding Unit Test Acceptance Test Maintenance 2.5 5 10 25 100 100:1 Cost Savings Results from finding errors in requirements stages versus finding errors in maintenance
Background image of page 7

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

View Full DocumentRight Arrow Icon
8 8>( 8>,(( ! ` " /9 I/J<:,( ! 60178#925) ! I/J<:,( ):. K( )/04=(H ! 0:L(1 2* 52M)+=* */ )/.)(4*+:=2N(7 :K1*,:)*7 E21+:=2N(7 :.5 )/00+.2):*( :K/+* ! 60&/0+125) ! 0+)> /9 *>( 5(123. 4,/)(11 5(:=1 <2*> 2.*(,9:)(1 */ (H21@.3 (.@@(1 :.5 1;1*(01 ! 1/J<:,( 0+1* K( :5:4*(5 */ </,L <2*> 4,(&(H21@.3 1;1*(01 ),(:@.3 :552@/.:= :.5 :,K2*,:,; )/04=(H2*; ! 64(&3#(.2825) ! 1/J<:,( .((51 */ )>:.3( :.5 (E/=E( ! =(:51 */ ,:425 3,/<*> 2. <>:* <( ):. +1( )/04+*(,1 */ 5/
Background image of page 8
9 8>( E/. F(+0:. . G/04+*(, ! B(0/,;A >/=51 *>( 2.1*,+)@/.1 :.5 5:*: ! O,/)(112.3 +.2*A 4,/)(11(1 *>( 2.9/,0:@/. ! P.4+*A (H*(,.:= 2.9/,0:@/. 2.*/ *>( 0(0/,; ! Q+*4+*A 4,/5+)(1 ,(1+=*1 9/, *>( +1(, ! G/.*,/= +.2*A 0:.:3(1 )/04+*(, :)@E2*; Memory (RAM) Processing Unit MAR MDR ALU Control Unit PC IR R(321*(,S1T 5(E2)( >:.5=(, 5(E2)( >:.5=(,
Background image of page 9

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

View Full DocumentRight Arrow Icon
10 A Computer Program contains a set of instructions for the computer. ! G/.*:2.1 : 1(* /9 2.1*,+)@/.1 *>:* *(== *>( )/04+*(, (H:)*=; <>:* */ 5/A ! D>(. (H()+*(5A (H21*1 2. *>( 9/,0 /9 0:)>2.( )/5( SK2.:,; .+0K(,1T ! D>(. )/5(5A (H21*1 2. *>( 9/,0 /9 >23>&=(E(= 4,/3,:002.3 =:.3+:3( S(U3U G /, V:E:T ! D>(. 9/,0+=:*(5 :1 : 5(123.A (H21*1 2. W/<)>:,*17 :=3/,2*>017 K=+(4,2.*1 !
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/03/2012 for the course E E 312 taught by Professor Krasner during the Spring '09 term at University of Texas.

Page1 / 42

lecture02-introC - EE312 SOFTWARE DESIGN AND IMPLEMENTATION...

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

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