Review Finish program Graphics Programming

Slides:



Advertisements
Similar presentations
2 pt 3 pt 4 pt 5pt 1 pt 2 pt 3 pt 4 pt 5 pt 1 pt 2pt 3 pt 4pt 5 pt 1pt 2pt 3 pt 4 pt 5 pt 1 pt 2 pt 3 pt 4pt 5 pt 1pt Statistics Terms Statistics Formulas.
Advertisements

Noadswood Science,  To know how to use Python to produce windows and colours along with specified co-ordinates Sunday, April 12, 2015.
Math notebook, pencil, and possibly calculator. Definitions  An outcome is the result of a single trial of an experiment.  The sample space of an experiment.
Describing Probability
Relation Input Output Function Domain Range Scatter Plot Linear Equation x - intercept y- intercept Slope Rise Run.
The probability that it rains is 70% The probability that it does NOT rain is 30% Instinct tells us that for any event E, the probability that E happens.
PLEASE PASS OUT YOUR ADVISORY FOLDERS! PROBABILITY What do you think the chances are…?
1.4 Equally Likely Outcomes. The outcomes of a sample space are called equally likely if all of them have the same chance of occurrence. It is very difficult.
Second Nine Weeks. October 12, 2010 Turn the fraction into a percent
Truth and while Today 15 Minutes online time to finish the random/Swing programs. Truth tables: Ways to organize results of Boolean expressions. Note Taking:
12.4 The Distance Formula Objectives: Use the distance formula to find the distance between 2 points in a coordinate plane. Determine whether a triangle.
Probability Bingo October 3, D Mathematics.
Program Options: 10 Minutes online Write a program that will display your home address as it would on an envelope. –First Name Last Name –Address –City,
Computer Science I: Understand how to evaluate expressions with DIV and MOD Random Numbers Reading random code Writing random code Odds/evens/…
Algebra 2 June 18, 2016 Goals:   Identify functions in coordinate, table, or graph form   Determine domain and range of given functions.
AP Java 10/1/2015. public class Rolling { public static void main( String [] args) public static void main( String [] args) { int roll; int roll; for.
9.3 - Circles Objectives: Write an equation for a circle given sufficient information. Given an equation of a circle, graph it and label the radius and.
Precalculus Section 6.2 Apply the equations of circles
GCSE COMPUTER SCIENCE Practical Programming using Python
Introduction to Discrete Probability
2.2: Translations.
All about circle.
Circles Objectives: Write the Standard Form and General Form of the Equation of a Circle Find the Center and Radius of a Circle in Standard Form and General.
For vs. While loop count=0 while count< 5: for count in range(5):
Math Jeopardy A B C D E Final Jeopardy.
AP Java 10/4/2016.
Statistics Terms Statistics Formulas Counting Probability Graphs 1pt
Week 8 - Monday CS 121.
Section 1.9 Distance and Midpoint Formulas and Circles
Program Options: 10 Minutes online
Rectangular Coordinates in 3-Space
Introduction to Functions
Chapter 3 Variables, Calculations, and Colors
Random numbers What does it mean for a number to be random?
Random numbers What does it mean for a number to be random?
A movement of a figure in a plane.
P.5 The Cartesian Plane Our goals are to learn
Truth tables: Ways to organize results of Boolean expressions.
Computer Science 1 Get out your notebook
1.6 Relations and Functions
Introduction to TouchDevelop
And and or…and RANDOMNESS
Computer Science And he made a molten sea, ten cubits from the one brim to the other: it was round all about, and his height was five cubits: and.
Dry run Fix Random Numbers
Program Options: 10 Minutes online
Truth tables: Ways to organize results of Boolean expressions.
9.3 Graph and Write Equations of Circles
Repeat Day2 Dry Run Second Repeat Program
Circles Objectives: Write the Standard Form and General Form of the Equation of a Circle Find the Center and Radius of a Circle in Standard Form and General.
Geometry Equations of Circles.
Truth tables: Ways to organize results of Boolean expressions.
Computer Science 1 Online time for Graphics Program Random review
Computer Science II Second With files.
Continue with Life, Magic and Catch -up
Computer Science 2 More Trees.
Computer Science 1 For..do loop Dry Run Take notes on the For loop
How can you make a guessing game?
Exploring Computer Science Lesson 4-10 – Part 2
Computer Science I: Get out your notes.
Computer Science 1 10/16/2018.
STANDARD 17:.
Circles in the Coordinate Plane
Random Numbers while loop
Computer Science 1 Get out your notebook
Computer Science 1 Get out your notebook
Dry Run Fix it Write a program
Graphing on a Coordinate plane
Random numbers What does it mean for a number to be random?
Bellwork: 5/13/16 Find the theoretical probability of each outcome
Circles Objectives: Write the Standard Form and General Form of the Equation of a Circle Find the Center and Radius of a Circle in Standard Form and General.
Presentation transcript:

Review Finish program Graphics Programming Computer Science 1 10-6-2016 Review Finish program Graphics Programming

Determine the Range of Values the following code generates Random(9) + 1 Random(12) – 4 Random(25) + 6 2*random(7) + 10 2*random(12) -1 3*random(6) + 4

Write the code to generate the following ranges 10 to 22 even 7 to 17 odd 12 to 40 by 4’s Flipping a coin Rolling a pair of 6-sided dice.

Program options. Random Flip a coin 100 times and count how many heads, tails Show how many heads and tails occurred and which occurred most often Roll a pair of dice 100 times and tell which occurred most often, a 3 or an 11. Math tutor User enters how many practice problems Program shows practice addition problems, gets the users guesses and tells the user how many they guessed correctly.

Number from 0-... Or some color constants (RED, BLUE, GREEN, …) 1920 1080 (0,0) (1920, 1080) Graphics in Pascal Screen size: 1920x 1080 Might be larger with this version of Pascal. Upside down Cartesian plane Change the screen to graphics mode Use the program graph1.pas from the website. Save it to your Computer Science 1 Folder before running Number from 0-... Or some color constants (RED, BLUE, GREEN, …)

Open this program, save it to your folder and modify it. Program Lesson8_Program1; Uses Crt,Graph; Var GraphicsDriver, GraphicsMode, ErrCode: smallint; Begin Writeln('Initialising Graphics, please wait...'); GraphicsDriver := Detect; InitGraph(GraphicsDriver, GraphicsMode,''); ErrCode := GraphResult; If GraphResult <> grOK then ClrScr; Writeln('Graphics error occured: ', GraphErrorMsg(ErrCode)); Halt(1); End; //Enter graphics commands here readln; Closegraph(); End. This is graphy1.pas. Open this program, save it to your folder and modify it. This code must go at the beginning of a program that uses the graphics commands

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);

What does this do?

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