Presentation is loading. Please wait.

Presentation is loading. Please wait.

Review Dry Run A Little More Math Fix it Online time

Similar presentations


Presentation on theme: "Review Dry Run A Little More Math Fix it Online time"— Presentation transcript:

1 Review Dry Run A Little More Math Fix it Online time
Intro to Programming Review Dry Run A Little More Math Fix it Online time

2 Learning Objectives Be able to Dry run a program that includes math operations and output Understand how to translate Math equations into Pascal. Be able to fix a program written poorly. Be able to develop a program in Pascal.

3 Which are valid variable names? Which are good variable names?
Yo 3daysleft Summer time X Q Top Score Address Begin Writeln End X1 X^2 What? Number from 1 to 13 and write valid/invalid and good/bad.

4 Dry run 1 (What do you think the following program does?)
{Mr. Smith's Sample Program} {Dry Run #2} { } program DryRunTest; uses crt; var a,b,c:integer; begin clrscr; a:= 20; b:= 16; c:= a+b; writeln(a, b, c); b:= c – 2*(a+b) -6; a:= c + b; end. Dry run 1 (What do you think the following program does?)

5 Math Math Pascal Code Example + Ans:= first+second; -
Ans:= second – first; x * Ans := first * second; ÷ / Ans := first / second () Ans := (first + 2)/second; π PI Ans := PI; 52 sqr Ans := sqr(first); Sqrt() Ans:= sqrt(first);

6 You turn: What is the result of the following?
Expression Answer Type 2+ 12 5*(8-15) 5 + 6*3 6 + 4/2 – 8 (6+4)/2 – 8 (6+4)/(2-8) Sqrt(9) Sqrt(4*4 + 9) Sqrt(sqr(3) + sqr(4))

7 Fix the following Fix5-20.pas in the assignments folder
Open it in Pascal, save it to your documents then fix it. Fix the following prograhm Fix it 1 {Finding the average of two numbers) Number1, number 2, The average:integers. start writeln("Please enter two numbers) readline(17, 13) number1+number2/2 = average Show The average of 17 and 13 is average stop

8 Write a program for one of the following
Extension: Look up If..then to check if the sides entered actually do make a triangle.


Download ppt "Review Dry Run A Little More Math Fix it Online time"

Similar presentations


Ads by Google