Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Science 1 10/16/2018.

Similar presentations


Presentation on theme: "Computer Science 1 10/16/2018."— Presentation transcript:

1 Computer Science 1 10/16/2018

2 Learning Targets Demonstrate your awesome ability to use the random command Be able to create a wonderful piece of Pascal art using graphic commands Prepare for a quiz on Friday by successfully completing a practice quiz.

3 Solve the Following Random(12)+3 Random(14) – 8 Random(10)+ 20
Find the range of values Write the code to generate the following ranges of random numbers Random(12)+3 Random(14) – 8 Random(10)+ 20 2*random(6)+5 2*random(10) – 3 5*random(12) - 6 5 to 15 -8 to 30 40 to 100 even 37 to 57 odd 5 to 50 every 5th

4 Some Pascal Graphics Commands
Some Commands SetColor(Integervariable); Circle(x, y, radius); ClearViewPort; //Like clearscreen Outtext(x, y, ‘String you will show on the screen’); Line(x1, y1, x2, y2); Lineto(x,y); Putpixel(x, y, ColorValue); Rectangle(x1, y1, x2, y2); Ellipse(x, y, Start Degrees, End Degrees, Horizontal Radius, Vertical Radius); Colorvariable:=getpixel(x, y);

5 Today First graphics program Inside circle program:
Face Stick figure House Inside circle program: Input: The (x,y) coordinate and center of a circle. Also the (x2,y2) coordinates of another point Output: Whether or not the point is inside the circle. (Hint: Use the distance formula) Push: In addition, show this graphically Intersecting circles program: Input: x, y and radius for two circles. Output whether or not the circles intersect. Push: Add graphics


Download ppt "Computer Science 1 10/16/2018."

Similar presentations


Ads by Google