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,

Slides:



Advertisements
Similar presentations
E.g.9 For to do loop for i:=1 to 10 do writeln(i); While do loop i:=1;
Advertisements

Computing Science Software Design and Development SOFTWARE DESIGN AND DEVELOPMENT USING PYTHON.
CMSC 104, Version 9/011 Arithmetic Operators Topics Arithmetic Operators Operator Precedence Evaluating Arithmetic Expressions In-class Project Incremental.
Surface Area of a cylinder Objective: Be able to calculate the surface area of a cylinder.
 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 units.
INTRODUCTION TO PROGRAMMING
Pseudocode and Algorithms
Moving To Code 3 More on the Problem-Solving Process §The final step in the problem-solving process is to evaluate and modify (if necessary) the program.
Chapter 3 Planning Your Solution
Review Algorithm Analysis Problem Solving Space Complexity
Software Engineering 1 (Chap. 1) Object-Centered Design.
Lecture 1: Introduction Lecture series based on the text: Essential MATLAB for Engineers and Scientists By Hahn & Valentine
CPSC 171 Introduction to Computer Science 3 Levels of Understanding Algorithms More Algorithm Discovery and Design.
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.
E0001 Computers in Engineering
General Programming Introduction to Computing Science and Programming I.
CSEB114: Principle of programming
Arithmetic Operators Topics Arithmetic Operators Operator Precedence
Chapter 4: Subprograms Functions for Problem Solving Mr. Dave Clausen La Cañada High School.
C++ Basics C++ is a high-level, general purpose, object-oriented programming language.
Programming, an introduction to Pascal
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.
Bellwork  Solve for x!  1.x + 3 = 12  2.x – 8 = - 14  x = - 17  x = - 2.
1 Cylinders and Cones. 2 Surface Area (SA) = ph + 2B = 2πrh + 2πr 2 Cylinders are right prisms with circular bases. Therefore, the formulas for prisms.
Introduction to programming Carl Smith National Certificate Year 2 – Unit 4.
CMSC 104, Version 8/061L10ArithmeticOps.ppt Arithmetic Operators Topics Arithmetic Operators Operator Precedence Evaluating Arithmetic Expressions In-class.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake An Introduction to Programming.
Exercise 1 #include int main() { printf(“Hello C Programming!\n”); return 0; } 1.Run your Visual Studio 2008 or Create a new “project” and add.
Computer Science 1 How do you store a bunch of similar stuff?
 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 units.
Computer Science I: Understand how to evaluate expressions with DIV and MOD Random Numbers Reading random code Writing random code Odds/evens/…
12-3: Volumes of Prisms and Cylinders. V OLUME : the measurement of space within a solid figure Volume is measured in cubic units The volume of a prism.
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.
1 Project 4: Computing Distance. 222 Computing Distance Write a program to compute the distance between two points. Recall that the distance between the.
CS 101 – Oct. 7 Solving simple problems: create algorithm Structure of solution –Sequence of steps (1,2,3….) –Sometimes we need to make a choice –Sometimes.
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?
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.
Nouns Nouns not noun noun noun not not
Program Options: 10 Minutes online
Review Dry Run A Little More Math Fix it Online time
Lecture 1: Introduction
Program options Write a program for one of the following
Review Finish program Graphics Programming
Review Dry Run Taking Names Online time Math is Good
Computer Science 1 Get out your notebook
Program Options: 10 Minutes online
Algorithm and Ambiguity
Python 19 Mr. Husch.
Computer Science 1 Warm-up: True/False Dry Run
What do you do when you don’t know how to get started.
AP Java String Review Learning Objectives
Computer Science 1 Online time for Graphics Program Random review
How can you make a guessing game?
Computer Science Procedures Day 2.
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?
Warm-up: True/False Dry Run DIV / MOD 2nd If Then Program
Computer Science I: Get out your notes.
Python 19 Mr. Husch.
Program options Write a program for one of the following
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
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 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.

Computer Science 1 9/15/2015 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:= ; –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; writeln(a, b, c); end. a b c Screen

Math PascalCode Example ++Ans:= first+second; --Ans:= second – first; x*Ans := first * second; ÷/Ans := first / second () Ans := (first + 2)/second; πPIAns := PI; 5252 sqrAns := sqr(first); √Sqrt()Ans:= sqrt(first);

You turn: What is the result of the following? ExpressionAnswerType *(8-15) 5 + 6* /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:= ; –Y:= 10; –Writeln(y); –Writeln(‘Hello’, y); –Writeln(‘World’, x:10:2); –readln; End.

Evaluate the following 2*5-6 Sqr(8-2*2) Sqrt(8-2*2) Translate to Pascal X-2y (1/2)(bh)

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: –Surface area = πr 2 + πr 2 +2 πrh –Volume = πr 2 h Output: The Volume and surface area of the cylinder.

Hands on –Surface area = πr 2 + πr 2 +2 πrh –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