# sec3 - CS100M Section Exercise 3 1 for while[P2.3.2 from...

• Lab Report
• 2

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

CS100M Section Exercise 3 1 for while [P2.3.2 from FVL ] Define an integer as “good” if it is not divisible by 2, 3, 5, or 7. Write a script that displays the number of positive “good” integers less than one million. (a) Use a for -loop. (b) Use a while -loop. 2 Matlab graphics: circles & rectangles Complete the script below to draw as many non-overlapping circles as possible inside a rectangle. The diameter of each circle is the width of the rectangle. Center the set of circles inside the rectangle. Assume that functions DrawRect and DrawDisk are available. Read the function comments, shown below, to find out how to use the functions. Assume that all the graphics commands for setting up a figure window have been entered—write only the code to draw the rectangle and circles. Use a loop to draw the circles! Problem Solving Strategy : Work on a problem in steps! Solve a simpler version first—draw the first circle tangent to the left side of the rectangle. After you figure out this simpler version, then modify your code to center the

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

This is the end of the preview. Sign up to access the rest of the document.
• Summer '07
• FAN/VANLOAN
• Rectangle, h., 1 %

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern