Warm-up: True/False Dry Run DIV / MOD 2nd If Then Program

Slides:



Advertisements
Similar presentations
Mod arithmetic.
Advertisements

1. ( ) ÷ 1 = (A) 1818 (B) 1414 (C) 4 15 (D) 1212 (E) ( ) ÷ 1 = ÷ 1 = = ( ) ÷ 1 =
Pascal Syntax. What you have learnt so far writeln() and write(); readln() and read(); variables (integers, strings, character) manipulation of variables.
Order of operators: x ** y x * y, x / y, x // y, x % y x + y, x - y
2nd grade Math Lesson 2.MD.8. Solve word problems involving dollar bills, quarters, dimes, nickels, and pennies, using $ and ¢ symbols appropriately.
1.List 2.The 3.Possibilities Being thorough and complete without wasting time being redundant is also an important skill in mathematics. Besides promoting.
19/5/2015CS150 Introduction to Computer Science 1 Announcements  1st Assignment due next Monday, Sep 15, 2003  1st Exam next Friday, Sep 19, 2003  1st.
Synthetic Division. This method is used to divide polynomials, one of which is a binomial of degree one.
Computer Science 210 Computer Organization Introduction to Boolean Algebra.
Copyright 1999 by Larry Fuhrer. Pascal Programming Getting Started...
Jeopardy Functions Review. Solve equations 100 ANSWER.
Basic Money Skills Basic Consumer Math Lesson 1 Introduction Mrs. Stack.
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
Counting Coins. The Basics Quarter 25 cents Dime 10 cents.
2 nd Quarter Math Review Click here to Begin = ? Add the numbers below. Choose the correct answer
Canadian Money. Coins Penny 1 cent 1¢ Nickel 5 cents 5¢
Let’s Learn About Money!
Name the United States Coins Count the Pennies 10 ¢
MATH AND MONEY.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Algebraic thinking Math 123. Warm-up Solve the following equations: 2a - 13 = 15a 3b – 8 = 4b – 4c = 15.
How Many Coins Do You Need? Billy Williams, Jr. EDU 450.
 1. The points whose coordinates are (3,1), (5,-1), and (7,-3) all lie on the same line. What could be the coordinates of another point on that line?
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/…
Betty Bob has six more nickels than dimes. The total amount of money she has is $3.30. How many of each coins does she have? Warm Up.
Math Challenge 12/1 Solve the following = ____ = _____ = _____.
Algebra 1 Section 6.3 Solve and graph compound inequalities A compound inequality is form by combing two inequalities. A new born calf should weigh greater.
PreCalculus 5-4 Common and Natural Logarithmic Functions.
3x + 2 6x3 - 5x2 – 12x – 4 2x2 – 3x – 2 6x3 + 4x2 -9x2 – 12x -9x2 – 6x
Computer Science 210 Computer Organization
Assignment statement and Arithmetic operation 2
Temperature: Comparing degrees Celsius (C) and degrees Fahrenheit (F)
Program Options: 10 Minutes online
CMP 131 Introduction to Computer Programming
Program options Write a program for one of the following
Computer Science II First With files.
Review Dry Run Taking Names Online time Math is Good
kbkjlj/m/lkiubljj'pl;
Name the United States Coins
Dry run Fix Random Numbers
More Maths Programming Guides.
Program Options: 10 Minutes online
Repeat Day2 Dry Run Second Repeat Program
Computer Science 1 Warm-up: True/False Dry Run
Computer Science
What do you do when you don’t know how to get started.
Computer Science 1 Online time for Graphics Program Random review
How can you make a guessing game?
Computer Science II Second With files.
Computer Science 2 Take out a piece of paper for the following dry runs. Label It Recursive Dry Runs 4/12/2018. It will be turned in when completed
Computer Science 2 More Trees.
Computer Science Procedures Day 2.
Computer Science 1 while
Computer Science 1 For..do loop Dry Run Take notes on the For loop
Warm-up: Dry Run DIV / MOD 2nd If Then Program
How can you make a guessing game?
Computer Science
FORMULAS.
Computer Science I: Get out your notes.
Section 1.5 Solving Equations.
Program options Write a program for one of the following
Dry Run Fix it Write a program
Ask A Cricket The Temperature
Computer Science 1 while
Dry Run Fix it Write a program
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.
Warm-Up Problems Unit 0.
COMPUTING.
Computer Science II First With files.
Presentation transcript:

Warm-up: True/False Dry Run DIV / MOD 2nd If Then Program Computer Science 1 Warm-up: True/False Dry Run DIV / MOD 2nd If Then Program

Take out your notes and number your paper from 1 to 11. Var A,b,c:integer; E,f,g:real; H, i:string; Begin A:= 5; b:=10;c:=2; E:=5.0;f:=3.0;g:=10.5; H:= ‘Howdy’;i:= ‘Doody’; 1) a<b 2) c>a 3) e>c 4) h<= i 5) (a<b) or (a<c) 6) (3*a >g) 7) (a<b) and (b<c) 8) NOT (a>10) 9) H > i 10) NOT (H = ‘howdy’) 11) H > A Take out your notes and number your paper from 1 to 11. George Boole True, False or crash

Dry run the following program dryruny; var one, two:integer; begin two:= one*2 - 1; writeln(one:6, two:6); if (one <= two) then writeln('Scooby') else writeln('Scrappy'); end.

Dry Run the following program ifOne; var a,b:integer; begin a:= 10; if a>b then a:= a - 4; b:=b+1; end; writeln(a,b); readln; end.

DIV Pascal’s Integer Division How can you get an integer result when you divide? For example, if you divide 5 by 2 what do you think the answer would be? What about the remainder. Pascal has math operations for finding the result of integer division and the remainder of integer division.

DIV and MOD DIV is used to find the result of integer division For example X := 13 DIV 5; X:= 21 DIV 10; X:= 20 – 8 DIV 3; x:= 1 DIV 2; MOD is used to find the remainder of integer division X := 13 MOD 5; X:= 21 MOD 10; X:= 20 – 8 MOD 3; x:= 1 MOD 2;

DIV and MOD samples Ans:=23 DIV 10; Ans:= 14 DIV 4; Ans:= 52 DIV 5; Ans:= 23 MOD 10; Ans:= 14 MOD 4; Ans:= 52 MOD 5; Ans:= 14 MOD 3; Ans:= 8 MOD 9; Ans:= 5 MOD 10; Ans:= 4.13 MOD 2;

Program options. Input: The amount of change (Integer value, like 66 cents) Output: The least amount of coins it takes to make the change: For 66 cents 2 Quarter(s) 1 Dime(s) 1 Nickel(s) 1 Penny/Pennies Input: The number of Chirps per minute for a cricket. Output: The outside temperature in Fahrenheit and give an appropriate statement if the temperature is greater than 90 degrees F. Using his equation, called Dolbear's Law, you can determine the approximate temperature in Fahrenheit, based on the number of cricket chirps you hear in one minute. Dolbear's Law: T = 50+[(N-40)/4]  T = temperature  N = number of chirps per minute Push: Add other comments for different temperatures, The above equation is for field crickets, look up equations for different types of crickets.