Introduction to Programming Doman’s Lecture CSCI101.

Slides:



Advertisements
Similar presentations
Chapter 6 Writing a Program
Advertisements

INTRODUCTION Chapter 1 1. Java CPSC 1100 University of Tennessee at Chattanooga 2  Difference between Visual Logic & Java  Lots  Visual Logic Flowcharts.
Formal Description of a Problem
CS001 Introduction to Programming Day 3 Sujana Jyothi
1 CSC 221: Computer Programming I Fall 2006 See online syllabus (also accessible via Blackboard): Course goals:  To develop.
Fundamentals of Computer Science Lecture 14: Recursion Instructor: Evan Korth New York University.
Problem solving by Searching Problem Formulation.
Computer Science 1620 Programming & Problem Solving.
ROBOT Computer and its Programs
10-1 Programming Remember: –programming language –how to program (conceptually) –intro to programming the “ROBOT” computer In this lecture: –programming.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
Introduction To C++ Programming 1.0 Basic C++ Program Structure 2.0 Program Control 3.0 Array And Structures 4.0 Function 5.0 Pointer 6.0 Secure Programming.
Problem Solving. What is a Problem? An ambiguous situation not clearly showing how to reach the goal. Given Initial Situation Desired Goal Situation What.
Improving the Odds of Success in Computer Science 1 Dr. Wayne Summers TSYS School of Computer Science 16 November 2012.
Object Oriented Programming
CSCI-100 Introduction to Computing Algorithms Part I.
Data Structures Using C++ 2E Chapter 6 Recursion.
© 2004 Pearson Addison-Wesley. All rights reserved October 27, 2006 Recursion (part 2) ComS 207: Programming I (in Java) Iowa State University, FALL 2006.
UNIVERSITI TENAGA NASIONAL “Generates Professionals” CHAPTER 4 : Part 2 INTRODUCTION TO SOFTWARE DEVELOPMENT: PROGRAMMING & LANGUAGES.
Data Structures Using C++ 2E Chapter 6 Recursion.
1 State Space of a Problem Lecture 03 ITS033 – Programming & Algorithms Asst. Prof.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
1 CSC 221: Introduction to Programming Fall 2013 See online syllabus (also accessible via BlueLine2): Course goals:  To develop.
Introduction to Programming Initial Slides developed by Dr. Doman.
The Program Development Cycle
Se Over the past decade, there has been an increased interest in providing new environments for teaching children about computer programming. This has.
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 13: An Introduction to C++
Programming Concept Chapter I Introduction to Java Programming.
CS 1308 Computer Literacy and The Internet Software.
Art 321 Lecture 7 Dr. J. Parker. Programming In order to ‘make things happen’ on a computer, you really have to program it. Programming is not hard and.
Unit 1: Basics // Metrics & Matter Aim: How can we apply the Scientific Method? Do Now: Solve the farmer’s dilemma. (5 minutes) Monday, September 8, 2014.
Jens Dalsgaard Nielsen Jan Dimon Bendtsen Dept. of Electronic Systems Basic Programming INS-basis GF, PDP and HST.
Data Structures Using C++ 2E1 Recursion and Backtracking: DFS Depth first search (a way to traverse a tree or graph) Backtracking can be regarded as a.
Sudoku Jordi Cortadella Department of Computer Science.
CPSC 230 Computers and Programming I Spring 2003 Dr. Lynn Lambert.
Graphs. Made up of vertices and arcs Digraph (directed graph) –All arcs have arrows that give direction –You can only traverse the graph in the direction.
CPSC 433 Artificial Intelligence Search Modeling Practice Problems M. Reza Zakerinasab Please include [CPSC433] in the subject line.
Moving Arrays -- 1 Completion of ideas needed for a general and complete program Final concepts needed for Final Review for Final – Loop efficiency.
1 12/4/1435 h Lecture 2 Programs and Programming Languages.
1 CSC 221: Computer Programming I Fall 2009 See online syllabus (also accessible via BlueLine): Course goals:  To develop.
Teaching Through Problem Solving
1 Recursion Recursion is a powerful programming technique that provides elegant solutions to certain problems. Chapter 11 focuses on explaining the underlying.
COIT29222 Structured Programming 1 COIT29222-Structured Programming Lecture Week 02  Reading: Textbook(4 th Ed.), Chapter 2 Textbook (6 th Ed.), Chapters.
CSC 107 – Programming For Science. Science Means Solving Problems  Physics – How does an atom work?
Objective You will be able to define the basic concepts of object-oriented programming with emphasis on objects and classes by taking notes, seeing examples,
Problem solving Introduction to programming. Do Now You are at a river that you want to cross with all your goods. Your goods consist of a chicken, a.
Programming for Interactivity Professor Bill Tomlinson Tuesday & Wednesday 6:00-7:50pm Fall 2005.
AS Computer Studies Algorithms & Problem Solving 1 & 2.
Software Engineering Algorithms, Compilers, & Lifecycle.
UFCFY5-30-1Multimedia Studio Coding for Interactive Media Fundamental Concepts.
The Origins of Psychology
How do you define AI? You were supposed to write a paper for today?
Problem solving by Searching
Chapter 1 - An Introduction to Computers and Problem Solving
Recursive Thinking Chapter 9 introduces the technique of recursive programming. As you have seen, recursive programming involves spotting smaller occurrences.
Recursive Thinking Chapter 9 introduces the technique of recursive programming. As you have seen, recursive programming involves spotting smaller occurrences.
Wednesday 20th November Mr Nicholls
Recursion (part 2) October 26, 2007 ComS 207: Programming I (in Java)
Welcome to <INSERT school name>’s
Chapter 11 Recursion.
11 Recursion Software Solutions Lewis & Loftus java 5TH EDITION
The Challenge of Cross - Language Interoperability
Welcome to Mountain View Elementary School!
Recursion (part 2) March 22, 2006 ComS 207: Programming I (in Java)
Quiz: Computational Thinking
1.3.7 High- and low-level languages and their translators
Java Software Solutions Foundations of Program Design Sixth Edition
CSC 221: Introduction to Programming Fall 2018
Problem Solving by Searching Search Methods :
Presentation transcript:

Introduction to Programming Doman’s Lecture CSCI101

A deep understanding of programming, in particular the notions of successive decomposition as a mode of analysis and debugging of trial solutions, results in significant educational benefits in many domains of discourse, including those unrelated to computers and information technology per se. (Seymour Papert, in "Mindstorms") What is programming?

 Programming is a creative process done by programmers to instruct a computer on how to do a task. (  Writing an original program that performs a particular task that meets all stated constraints (Think Like a Programmer, V.Anton Spraul, No Starch Press, Inc. 2012) What is programming?

A lot of this lecture is taken from the book: Think Like a Programmer, By V.Anton Spraul, No Starch Press, Inc What is programming?

Method or interface to do this: PROGRAMMING LANGUAGES Example: Java: Public class helloWorld { Public static void main ( ) { system.out.println(“Hello World”) } } Instruct a computer

Example: C++ #include using namespace std; int main() { cout << “Hello World” << endl; } Instruct a computer

Example: html Hello World Instruct a computer

GAMEMAKER Drag and drop structured language Uses icons, text…. Made to be easier than any of the previous languages. Instruct a computer

 Programming is a creative process done by programmers to instruct a computer on how to do a task. ( What is programming?

 Programming is a creative process done by programmers to instruct a computer on how to do a task. (  Writing an original program that performs a particular task that meets all stated constraints (Think Like a Programmer, V.Anton Spraul, No Starch Press, Inc. 2012) What is programming?

 Puzzles  Problem solving What is programming?

Your car has blue smoke coming from the tailpipe, is idling roughly and has lost fuel efficiency. How do you solve it? Problem Solving

 Unbreakable rules about problems or the way in which problems must be solved.  Car problem constraints:  Cost of repair  How long before you need it fixed  No new tools be purchases Constraints

 Programming language  Platform  Performance  Memory footprint  User/customer specific constraints  Design constraints. Common Programming Constraints

 Figure out the steps to take to solve the problem  Be able to list the steps  Be able to repeat the steps  You can NOT change the rules (constraints) to get something solved! Problem solving

P ROBLEM : H OW TO CROSS THE RIVER ? A farmer with a fox, a goose and a sack of corn needs to cross a river. The farmer has a rowboat, but there is only room for the farmer and one of his three items. Unfortunately, both the fox and the goose are hungry. The fox cannot be left alone with the goose; the goose cannot be left alone with the grain. How does the farmer get everything across the river? Puzzle: Fox, goose, grain

 Constraints  Only one item at a time in the boat  Can’t leave fox with goose  Can’t leave goose with grain  Operations  Carry the fox to the far side of the river  Carry the goose to the far side of the river  Carry the grain to the far side of the river Puzzle: Fox, goose, grain

 Abstract the problem  Be more general in describing the way we will solve the problem  Concept: Variable Items are fox, goose or grain Let item vary between fox, goose or grain Rephrase the problem

 Constraints  Only one item at a time in the boat  Can’t leave item(fox) with item(goose)  Can’t leave item(goose) with item(grain)  Operations  Row the boat from one shore to the other  If the boat is empty, load an item on the boat  If the boat is full, take the item off the boat Puzzle: Fox, goose, grain

Puzzle: Sudoku

 Constraints   Techniques  Start with the easiest  Try something…… be prepared to change if it doesn’t work.  Try something else Puzzle: Soduko

P ROBLEM : T HE SLIDING EIGHT A 3x3 grid is filled with eight tiles, numbered 1 through 8 with one empty space. The grid is jumbled. A tile can be slid into an adjacent empty space, leaving its previous location empty. Slide the tiles so that they are in numerical order Puzzle: Sliding Tile

Puzzle: Sliding Tile Solution

Puzzle: Sliding Tile

Technique: the train A circuit of tile positions that include an empty slot forms a train of tiles that can be rotated anywhere along the circuit, preserving the relative order of the tiles. Puzzle: Sliding Tile

 Look at the problem in subsets  P ROBLEM : T HE SLIDING FIVE Puzzle: Sliding Tile

 Use this technique to generalize the solution to any sliding puzzle….. Puzzle: Sliding tile

 Use this technique to generalize the solution to any sliding puzzle….. Puzzle: Sliding tile

 Use this technique to generalize the solution to any sliding puzzle….. Puzzle: Sliding tile

 Use this technique to generalize the solution to any sliding puzzle….. Puzzle: Sliding tile

 Use this technique to generalize the solution to any sliding puzzle….. Puzzle: Sliding tile

 Use this technique to generalize the solution to any sliding puzzle….. Puzzle: Sliding tile

Problem Solving  Have a plan  Generalize the problem  Restate the problem  Start with what you know  Divide the problem  Look for analogies or patterns  Experiment!!! THINK like a programmer!