Engineering 1020 Introduction to Programming Peter King Winter 2010.

Slides:



Advertisements
Similar presentations
Motion in 2 Dimensions Projectile Motion
Advertisements

compilers and interpreters
Python Programming Chapter 5: Fruitful Functions Saad Bani Mohammad Department of Computer Science Al al-Bayt University 1 st 2011/2012.
1E10 Lecture in Design Mechanical & Manufacturing Engineering
Engineering EG167C - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect M1 P. 1Winter Quarter Midterm I Review.
Limits and Their Properties Copyright © Cengage Learning. All rights reserved.
1 ENGI 2420 Structured Programming (Lab Tutorial 0) Memorial University of Newfoundland.
Introduction to C Programming CE Lecture 1 Introduction to C.
CSE123 Introduction to Computing Lecture 1 Introduction Engineering Problem Solving.
Introduction to a Programming Environment
Circumference of a Circle Math 10-3 Ch.3 Measurement.
GeometryGeometry Lesson 75 Writing the Equation of Circles.
Standard Form for the Equation of the Circle
What is RobotC?!?! Team 2425 Hydra. Overview What is RobotC What is RobotC used for What you need to program a robot How a robot program works Framework.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Java Programs COMP 102 #3.
Intro to Java Programming  A computer follows the instruction precisely and exactly.  Anything has to be declared and defined before it can be used.
Fruitful functions. Return values The built-in functions we have used, such as abs, pow, int, max, and range, have produced results. Calling each of these.
INTRODUCTION TO C PROGRAMMING LANGUAGE Computer Programming Asst. Prof. Dr. Choopan Rattanapoka and Asst. Prof. Dr. Suphot Chunwiphat.
Engineering 1020 Introduction to Programming Peter King Winter 2010.
Computing Science 1P Lecture 21: Friday 20 th April Simon Gay Department of Computing Science University of Glasgow 2006/07.
CSCI 130 Chapter 1. History of C Bell Telephone Laboratories (1972) Dennis Ritchie (also created UNIX) A - B - C.
Session One Introduction. Personal Introduction Role of programmers Robot Examination HUD & HID Uploading Code.
Engineering 1020 Introduction to Programming Peter King Winter 2010.
Problem Solving and Program Design in C (5th Edition) by Jeri R. Hanly and Elliot B. Koffman CP 202 Chapter 3 Slides By Dr. Daniyal Alghazzawi.
Circumference and Area of a Circle. Diameter Radius centre What is the formula relating the circumference to the diameter?
CSE 131 Computer Science 1 Module 1: (basics of Java)
Recognising formulae A formula gives you a way to work out the value of something given other information. You use formulae across the curriculum. Which.
S2008Final_part1.ppt CS11 Introduction to Programming Final Exam Part 1 S A computer is a mechanical or electrical device which stores, retrieves,
How to start Visual Studio 2008 or 2010 (command-line program)
Solving Literal Equations
Circular Motion A brief intro.. Uniform Circular Motion UCM is the movement of an object or particle trajectory at a constant speed around a circle with.
Chapter 1 Introduction Chapter 1 Introduction 1 st Semester 2015 CSC 1101 Computer Programming-1.
C++ Basics C++ is a high-level, general purpose, object-oriented programming language.
1 C++ Programming Basics Chapter 1 Lecture CSIS 10A.
PROPORTION Given that y is proportional to x, find the missing values of y x y18.
CirclesCircles 11.5 Equations of Circles Objective: To write an equation of a circle.
Numbers, Expressions, and Simple Programs. Today’s Goals Discipline! Order! Developing programs requires care! Programs are useful but delicate entities.
OCR GCSE Computing © Hodder Education 2013 Slide 1 OCR GCSE Computing Python programming 1: Introduction.
Circumference Review. Review What is the relationship between a radius and a diameter? What does a circumference measure? What formulas do we use to calculate.
Math – Distance and Midpoint Formulas; Circles 1.
Writing Equations by Completing the Square Or Using the Distance Formula.
Finding the area of circles
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Java Programs COMP 102 #3.
Equations of Circles. Vocab Review: Circle The set of all points a fixed distance r from a point (h, k), where r is the radius of the circle and the point.
Introduction to Eclipse Programming with an Integrated Development Environment.
The Variance of a Random Variable Lecture 35 Section Fri, Mar 26, 2004.
Uniform circular motion is the motion of an object traveling at a constant speed on a circular path. Uniform Circular Motion.
© Peter Andreae Java Programs COMP 102 # T1 Peter Andreae Computer Science Victoria University of Wellington.
Engineering 1020 Introduction to Programming Peter King Winter 2010.
CSCI 161 Lecture 3 Martin van Bommel. Operating System Program that acts as interface to other software and the underlying hardware Operating System Utilities.
Objective - To find the area of a circle. The area of a circle is the product of and the square of the radius. Find the area of the circle. Use 3.14 for.
Chapter 1: Introduction to Computers and Programming.
Do Now:. Circumference What is circumference? Circumference is the distance around a circle.
Graphing Circles and Writing Equations of Circles.
Lesson 8.7 Concept: How to find the circumference of a circle. Guidelines: *The diameter of a circle extends from one side of the circle to the other.
CS 201 Lecture 1 (b) Using an IDE Tarik Booker CS 201: Introduction to Programming California State University, Los Angeles.
Multiplication Find the missing value x __ = 32.
5.1 The Unit Circle.
1 CS 192 Lecture 4 Winter 2003 December 8-9, 2003 Dr. Shafay Shamail.
Chapter 5: Preparing C Programs
CSE101-Lec#3 Components of C Identifiers and Keywords Data types.
Introduction to Programming
What Is a Program? A program is like an algorithm, but describes a process that is ready or can be made ready to run on a real computer Retrieved from:
Screen output // Definition and use of variables
Introduction to Computer Programming
Real or Ridiculous??!!.
Introduction to Programming
An Overview of C.
Distance-time graph.
2D Shapes Rectangle Circle Triangle Rectangle. What shape is the door? Rectangle.
Presentation transcript:

Engineering 1020 Introduction to Programming Peter King Winter 2010

ENGI 1020: Examples Lecture example from last class *

ENGI 1020: Examples IDE –Integrated Development Environment Eclipse Teaching Machine –Editing, compiling and debugging all under one roof –Multiple source files open at once

ENGI 1020: Examples Debugging –After you hit 'build', the real fun starts –Start at the top 1 error tends to lead to another –Think logically What's missing? Typing error? Wrong type? –Fresh eyes

ENGI 1020: Examples Ex #1 –In pre-calculus physics the distance an object travels is given by the formula: s = ut + 1/2at2 where u is the initial speed, a is a constant acceleration and t is the time. Create a function to compute s plus a main function to that tests it by calling it with some values.

ENGI 1020: Examples #1 –What's the contract? What data are we agreeing to return? –#returns What data do we require? –#params What should we call the function?

ENGI 1020: Examples #2 –Create a function to compute the area of a circle given its radius (note that a value for PI is not built in to C++ so use ) plus a main function to that tests it by calling it with some values.

ENGI 1020: Examples #2 –What's the contract? What data are we agreeing to return? –#returns What data do we require? –#param What should we call the function?

ENGI 1020: Examples #3 –Lets do a simple example, but with more utilization of variables. –Write a function that returns the square of a number. –Write a main function that calls our function once, and then again with the result of the first call –The output would look like: The square of 2 is 4 The square of the square of 2 is 16