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

Slides:



Advertisements
Similar presentations
Selection Process If … then … else.... Condition Process 2 Process 1 Y.
Advertisements

10-5 and 10-6 Volumes of Prisms, Cylinders, Pyramids, and Cones
Surface Area of a cylinder Objective: Be able to calculate the surface area of a cylinder.
INTRODUCTION TO PROGRAMMING
Program CheckPass; var TestScore, ExamScore : integer; FinalScore : real; Status : string; begin write(‘Enter the Test score:’); readln(Testscore); write(‘Enter.
CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 2, Lecture 2.
Chapter 2: Input, Processing, and Output
Functions and Equations of Two Variables Lesson 6.1.
Find the volume of a sphere
Warm-up Find the surface area of the prism below. 3 cm.
Computer Science: A Structured Programming Approach Using C1 3-7 Sample Programs This section contains several programs that you should study for programming.
1 Software John Sum Institute of Technology Management National Chung Hsing University.
Geometry 19 March 2013 Warm up: Check your homework. For EACH PROBLEM: √ if correct. X if incorrect. Work with your group mates to find and correct any.
Lecture 1: Introduction Lecture series based on the text: Essential MATLAB for Engineers and Scientists By Hahn & Valentine
Find the area of each circle.
2/4/2003CSCI 150: Introduction to Computer Science1 Introduction to Computer Science CSCI 150 Section 002 Session 6 Dr. Richard J. Bonneau IONA Technologies.
Geometry 10-4 Cylinders. Definitions The lateral surface of a cylinder is the curved surface that connects the two bases. The (total) surface area of.
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.
General Programming Introduction to Computing Science and Programming I.
INTRODUCTION TO ALGORITHMS PROGRAMMING. Objectives Give a definition of the term algorithm Describe the various parts of the pseudocode algorithm or algorithm.
Copyright 1999 by Larry Fuhrer. Pascal Programming Getting Started...
Volume of CYLINDERS V olume = Πr 2 h Volume is in: UNITS Gallon = 231 in 3 1 cubic foot of water equals gallons.
Introduction to Programming David Goldschmidt, Ph.D. Computer Science The College of Saint Rose Java Fundamentals (Variables, Arithmetic, etc.)
C++ Basics C++ is a high-level, general purpose, object-oriented programming language.
Programming, an introduction to Pascal
Volume of a Sphere Objective: To solve problems involving volumes of spheres and hemispheres.
11/21/ : Surface Area and Volume of Spheres 7.6: Surface Area and Volume of a Sphere Expectation: G1.8.1: Solve multistep problems involving surface.
20S Applied Math Mr. Knight – Killarney School Slide 1 Unit: Real Number System Lesson: 2D3D-L4 Surface Area and Volume of a Sphere Surface Area and Volume.
Geometry 12.4 Spheres. Please add sphere to your vocab list.
Warm up! Find the surface area of the backpack to the nearest inch:
Warm up! Find the surface area of the backpack to the nearest inch:
Algebra 1 Functions 2 Expression functions using function notation
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
1 More on Readln:numerical values Note: ENTER key counts sends a carriage return and a line feed to the computer definition: “white space”: space, tab,
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 1 How do you store a bunch of similar stuff?
Intro to Loops 1.General Knowledge 2.Two Types of Loops 3.The WHILE loop 1.
Volume of Cones & Spheres
Computer Science I: Understand how to evaluate expressions with DIV and MOD Random Numbers Reading random code Writing random code Odds/evens/…
Cylinder DAY 1. Cylinder: Warm-Up TIME: 5 minutes DIRECTIONS: Work at your table (in groups of 3 to 4) Define in your own word to what Cylinder means.
7.4: SURFACE AREA AND VOLUME OF CYLINDERS Expectation: G1.8.1: Solve multistep problems involving surface area and volume of pyramids, prisms, cones, cylinders,
Starter – Its the small things in life What’s wrong with this code Height = 10 Width = 10 A = Height * Width Print A Remember to check: Spelling Spacing.
Input and Output Output Prompt: –A message displayed to the user indicating what they are to enter. Should be clear and exact on what you want. write:
2.8 Manipulation of Formulas Algebra 1/2 9/13/11 Objective: Solve equations for given variables and use formulas to solve real-world problems.
Introduction to Algorithms
The CONST definition CONST Pi = , City = ‘New York’;
Chapter Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
Program Options: 10 Minutes online
Review Dry Run A Little More Math Fix it Online time
Program options Write a program for one of the following
Software John Sum Institute of Technology Management
Secondary math Volume.
Review Dry Run Taking Names Online time Math is Good
Computer Science 1 Get out your notebook
Computer Science 2 Getting an unknown # of …. Into an array.
Dry run Fix Random Numbers
Program Options: 10 Minutes online
Computer Science
What do you do when you don’t know how to get started.
Computer Science 1 For..do loop Dry Run Take notes on the For loop
ICS 3U Thursday, September 9.
Chapter 2: Input, Processing, and Output
Computer Science
Computer Science I: Get out your notes.
Check even answers: p.763.
Program options Write a program for one of the following
Computer Science 1 Get out your notebook
Computer Science 1 Get out your notebook
August 5, 2019 Write in your planner and on your stamp sheet:
4d – Program Design Lingma Acheson CSCI N331 VB .NET Programming
Presentation transcript:

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

What do you recall about… 1.Uses 2.Crt 3.Dry run 4.Writeln 5.Write 6.Readln 7.End 8.Variable names 9.Real 10.Integer 11.String 12.errors Number your page 1 to 12 and write a brief description for each of the following. Check with your neighbors if you are stuck

Warm-up: Dry run the following program dryrun9_15_10; uses crt; begin clrscr; write('To think that'); writeln('two and two are four'); writeln(' and neither five nor three.'); write('The heart of man'); writeln(' has long been sore'); writeln(' and long ''tis like to be.'); readln; end. To dry run it, write down what it shows on the screen in your notebook.

Which are valid variable names? Which are good variable names? 1.Yo 2.3daysleft 3.Summer time 4.X 5.Q 6.Top Score 7.Address 8.Begin 9.Writeln 10.End 11.X1 12.X^2 13.What? Number from 1 to 13 and write valid/invalid and good/bad.

Goals Warm/ Review See how to let Pascal do the math. Go through pseudo code for the second programming assignment Give second programming assignment

Translate the following into Pascal

Steps to code Hands on –Doing samples by hand. Pseudo code –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: Volume = πr 2 h Output: The Volume of the cylinder.

Hands on –Volume = πr 2 h 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 oWrite a program for one of the following oVolume and surface area of cylinder oInput: The radius and height of a cylinder. oProcess: oSurface area = πr 2 + πr 2 +2 πrh oVolume = πr 2 h oOutput: The Volume and surface area of the cylinder. oWrite a program to calculate the volume of a spherical cap. Include the needed inputs. oa = radius of the cap or = radius of the sphere oh = height of the cap

Write a second program for one of the following