Program Options: 10 Minutes online

Slides:



Advertisements
Similar presentations
6 Steps of the Programming Process
Advertisements

Lecture 1: Introduction Lecture series based on the text: Essential MATLAB for Engineers and Scientists By Hahn & Valentine
Geometry Formulas: Surface Area & Volume. A formula is just a set of instructions. It tells you exactly what to do! All you have to do is look at the.
Chapter 4: Subprograms Functions for Problem Solving Mr. Dave Clausen La Cañada High School.
Introduction to programming Carl Smith National Certificate Year 2 – Unit 4.
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,
1 Project 2: Using Variables and Expressions. 222 Project 2 Overview For this project you will work with three programs Circle Paint Ideal_Weight What.
Computer Science I: Understand how to evaluate expressions with DIV and MOD Random Numbers Reading random code Writing random code Odds/evens/…
1 Project 4: Computing Distance. 222 Computing Distance Write a program to compute the distance between two points. Recall that the distance between the.
Describe how to find the volume of a prism. Give at least 3 examples. Describe how to find the volume of a cylinder. Give at least 3 examples. Describe.
Computer Science 1 9/10/2014 Review Dry Run Math in Pascal How do you start, when you don’t know where to start?
15.1 More About High-Level Programming Languages Syntax and Semantics Each programming language contains its own rules for both syntax and semantics. Syntax.
Geometry Formulas: Surface Area & Volume.
Surface Area.
Goals Understand how to create and compare Strings.
Program Options: 10 Minutes online
Review Dry Run A Little More Math Fix it Online time
Lecture 1: Introduction
Computer Science and an introduction to Pascal
Program options Write a program for one of the following
Review Finish program Graphics Programming
Definitions A cylinder has two identical flat ends that are circular and one curved side. Volume is the amount of space inside a shape, measured in cubic.
Goals Understand how to create and compare Strings.
How do you store a bunch of similar stuff?
Java Variables, Types, and Math Getting Started
Truth tables: Ways to organize results of Boolean expressions.
Review Dry Run Taking Names Online time Math is Good
Computer Science 1 Get out your notebook
HOW TO CREATE A CLASS Steps:
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
Truth tables: Ways to organize results of Boolean expressions.
Problem Solving Skill Area 305.1
Find the surface area of a sphere
Repeat Day2 Dry Run Second Repeat Program
Python 19 Mr. Husch.
How do you store a bunch of similar stuff?
Computer Science 1 Warm-up: True/False Dry Run
Computer Science 2 Tally Arrays 2/4/2016.
What do you do when you don’t know how to get started.
AP Java String Review Learning Objectives
11.8 Surface Area and Volume of Spheres
Computer Science 1 Online time for Graphics Program Random review
How can you make a guessing game?
Computer Science Procedures Day 2.
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
11.7 Volume of Pyramids and Cones
How can you make a guessing game?
Computer Science
Warm-up: True/False Dry Run DIV / MOD 2nd If Then Program
Lesson 9-3: Cylinders and Cones
How do you store a bunch of similar stuff?
Just Basic Lesson 19 Mr. Kalmes.
Computer Science I: Get out your notes.
Python 19 Mr. Husch.
Program options Write a program for one of the following
Dry Run Fix it Write a program
10/27/2016 Dry Run 2 Case Programs Fix it Second Case Program
Computer Science 1 while
Computer Science 1 Get out your notebook
Computer Science 1 Get out your notebook
Dry Run Fix it Write a program
WJEC GCSE Computer Science
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.
A bit of Review Review, Dry Run, Program.
Presentation transcript:

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, State Zip Code Push: Let the user enter some or all of the information, and have your program format it. Write a mad-lib program Have the user enter at least 4 pieces of information. Noun, Adverb (honestly), Adjective (messy), Verb, Geographical location, … The computer will generate the mad-lib Here is a sample website http://us.penguingroup.com/static/packages/us/yreaders/madlibs/fun.html Write a program that shows a poem or song. Can be an original work. Include space as appropriate. Push: Look up for..do, or repeat..until to have your program repeat the song several times. Push: Use the Pascal tutorial to add color etc.

How do you start, when you don’t know where to start? Computer Science 1 Review Dry Run Math in Pascal How do you start, when you don’t know where to start?

Goals Improve in your ability to execute a dry run. See how to let Pascal do the math. Go through pseudo code for the second programming assignment Give second programming assignment

Review: What do you recall about…? Program review; Var X:real; Y:integer; begin Writeln(‘Hello world.’); x:= 5.4321; Y:= 10; Writeln(y); Writeln(‘Hello’, y); Writeln(‘World’, x:10:2); readln; End.

Dry run 1 (What do you think the following program does?) {Mr. Smith's Sample Program} {Dry Run #1} {9/15/2015} program DryRunTest; uses crt; var a,b,c:integer; begin clrscr; a:= 8; b:= 6; c:= a+b; writeln(a, b, c); b:= b + 2*a; a:= a + 7; end. Dry run 1 (What do you think the following program does?) a b c Screen

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

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

Summary Write a one to three sentence summary of using Math in Pascal.

Review: What do you recall about…? Program review; Var X:real; Y:integer; begin Writeln(‘Hello world.’); x:= 5.4321; Y:= 10; Writeln(y); Writeln(‘Hello’, y); Writeln(‘World’, x:10:2); readln; End.

Translate to Pascal Math Java 2(a+c) Ans=2*(a+c); 3x + 5y (1/2)bh πr2

Learning Objectives Be able to fix a poorly written program Review math in Pascal Determine how to start a program when you don’t know how to start Write programs that solve math problems

Fix it! Open this program from the class website. Save it into your CompurScience folder. Fix it Turn it in as yourNameFix9-15

What Math Operations do you recall? + - * / () Sqrt() Sqr() Abs()

Steps to code Hands on Pseudo code Dry Run Code Doing samples by hand. Write out instructions in English Dry Run Testing your instructions Code Translate the Pseudo-Code to Pascal.

Sample program Input: The radius and height of a cylinder. Process: Surface area = 2πr2+2 πrh Volume = πr2h Output: The Volume and surface area of the cylinder.

Hands on Test: Radius of 1 inch and height of 1 inch Surface area = πr2 + πr2 +2 πrh Volume = πr2h Test: Radius of 1 inch and height of 1 inch Radius of 2 inches and height of 10 inches

Pseudo Code Describe what we did to solve this.

Dry Run Test the pseudo code

Code Translate the Pseudo code to code, Pascal in the case of this class.

Program options Write a program for one of the following Volume and surface area of cylinder (YourNameCylinder) Input: The radius and height of a cylinder. Process: Surface area = πr2 + πr2 +2 πrh Volume = πr2h Output: The Volume and surface area of the cylinder. Write a program to calculate the volume of a spherical cap. Include the needed inputs. (YourNameSphere) a = radius of the cap r = radius of the sphere h = height of the cap

Write a second program for one of the following