{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture 7 Notes

# 00 157 314 471 628 sinx 00 10 00 10 00 plot based

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: raw the black square Draw a black square with side 2.1 And center (0,0) s = 2.1; DrawRect(-s/2,-s/2,s,s,’k’) Insight Through Compu,ng Reﬁnement Reﬁnement R = 1; k = 1; Repeat while R >.1 Draw the k- th star Update R and k R = 1; k = 1; while R >.1 Draw the k- th star R = R/1.2; k= k+1; end Insight Through Compu,ng Draw the kth star if k is odd Magenta , radius R. center (0,0) otherwise Yellow, radius R, center (0,0) Insight Through Compu,ng 7 2/13/14 Reﬁnement if rem(k,2)==1 DrawStar(0,0,R,’m’) else DrawStar(0,0,R,’y’) end Insight Through Compu,ng Solu,on R = 1; k = 1; while R >.1 if rem(k,2)==1 DrawStar(0,0,R,’m’) else DrawStar(0,0,R,’y’) end R = R/1.2; k= k+1; end Insight Through Compu,ng Numbers •  A number is a quan,ty •  Base 10, base 2, base B, are representa,...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online