CMPT 120 Lecture 2 - Introduction to Computing Science – Problem Solving, Algorithm and Programming.

Slides:



Advertisements
Similar presentations
CS101: Introduction to Computer programming
Advertisements

Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Introduction to Programming Lecture Number:. What is Programming Programming is to instruct the computer on what it has to do in a language that the computer.
An ordered sequence of unambiguous and well-defined instructions that performs some task and halts in finite time Let's examine the four parts of this.
INTRODUCTION TO ALGORITHMS PROGRAMMING. Objectives Give a definition of the term algorithm Describe the various parts of the pseudocode algorithm or algorithm.
Introduction to Computational Linguistics Programming I.
CHAPTER 1: INTRODUCTION TO COMPUTER SCIENCE Introduction to Computer Science Using Ruby (c) 2012 Ophir Frieder et al.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Flowcharts.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
5. Algorithm 1: Variables, Operators, Sequences 1.
All materials copyright UMBC unless otherwise noted CMSC201 Computer Science I for Majors Lecture 02 – Algorithmic Thinking.
Topic: Binary Encoding – Part 1
Algorithms and Programming
Chapter 1 – Introduction
Programming – Algorithms (Flowcharts)
Introduction to Computing Science and Programming I
CMSC201 Computer Science I for Majors Lecture 02 – Algorithmic Thinking Prof. Katherine Gibson Based on slides by Shawn Lupoli and Max Morawski at UMBC.
CMPT 120 Topic: Python’s building blocks -> More Statements
Topic: Introduction to Computing Science and Programming + Algorithm
Topic: Python’s building blocks -> Variables, Values, and Types
Topic: Functions – Part 1
Topic: Programming Languages and their Evolution + Intro to Scratch
Introduction to Programming
Topic: Introduction to Computing Science and Programming + Algorithm
Introduction to Algorithms
Topic: Python’s building blocks -> Statements
CSIS 104 –Intro. To Computer Science
Topic: Python’s building blocks -> Variables, Values, and Types
Lesson 1 An Introduction
It’s called “wifi”! Source: Somewhere on the Internet!
CMPT 120 Topic: Searching – Part 1
CMPT 120 Topic: Functions – Part 4
Algorithm and Ambiguity
Pseudocode Upsorn Praphamontripong CS 1110 Introduction to Programming
Topic: Functions – Part 2
Unit 2 Smarter Programming.
Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode
Algorithm and Ambiguity
CS 240 – Lecture 11 Pseudocode.
Program Control using Java - Theory
Lesson 2 Programming constructs – Algorithms – Scratch – Variables Intro.
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
Introduction to Algorithms
Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode
Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode
Introduction to Algorithms and Programming
Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode
` Structured Programming & Flowchart
Programming We have seen various examples of programming languages
Algorithm and Ambiguity
Understanding Problems and how to Solve them by using Computers
Click to add Text Computers & Instructions. Computers are given instructions in the form of computer programs that are created through the development.
Introduction to programming
Flowcharts and Pseudo Code
COMPUTATIONAL THINKING COMPUTATIONAL THINKING IN PROGRAMMING
Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode
Life is Full of Alternatives
Basic Concepts of Algorithm
Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode
Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode
Creating Maintainable code
CMPT 120 Lecture 3 - Introduction to Computing Science – Programming language, Variables, Strings, Lists and Modules.
CMPT 120 Lecture 15 – Unit 3 – Graphics and Animation
CMPT 120 Lecture 4 – Unit 1 – Chatbots
CMPT 120 Lecture 6 – Unit 1 – Chatbots
WRITING AN ALGORITHM, PSEUDOCODE, AND FLOWCHART LESSON 2.
Lecture 20 – Practice Exercises 4
Creating readable code
CMPT 120 Lecture 26 – Unit 5 – Internet and Big Data
Presentation transcript:

CMPT 120 Lecture 2 - Introduction to Computing Science – Problem Solving, Algorithm and Programming

Last Lecture Introducing the course Little activity -> Thank you! What is this course all about? All we need is … How is this course going to work? Little activity -> Thank you! Our first program! Q&A Summary

Today’s Menu Course Title: “Introduction to Computing Science and Programming 1” This slide is from our Lecture 1.

Reading Review What is the single most important skill for a computer scientist? Comments and ________ ________ can make your programs much easier for humans to parse. Use them liberally! What is the difference between a natural language and a formal language?

Unit 0 What is Computing Science? In the first week, we'll talk about what computing science is, where it comes from, why it's awesome, and start to learn about how it works. You'll get set up with the tools that we'll be using in this class to help you become proficient computer scientists by the end of this course. By the way, in computing, we count from 0 :)

1st part of the course’s title: What is Computing Science? Study of computation -> all aspects of problem solving a.k.a. computational thinking Source: https://corporatetrainingmaterials.com/course/Creative_Problem_Solving https://www.sandler.com/blog/bring-problem-prospect-does

BTW: Computing or Computer Science? “Computing science is as much about computers as astronomy is about telescopes." From wiki: “Despite its name, a significant amount of computer science does not involve the study of computers themselves.” Computer: a tool Computing: field of study

Activity – Solving a Problem What are the steps we go through when we solve a problem? Take 5 minutes to … Pair up Pick a problem you both have experienced Identify the steps you go through when you solved your problem

Steps of Problem Solving

What is an algorithm? A finite sequenced set of unambiguous steps that, once executed, produces a result Finite: This set of steps executes in a finite amount of time i.e. it should finish at some point Sequenced: The steps must be executed in the order in which they are listed Unambiguous: Each step is clear Result: This result solves the initial problem The algorithm also describes The data it needs in order to work -> input The result it produces -> output

More about algorithm Video Algorithms from Khan Academy

Activity - Human meets alien!

How do we express an algorithm? 1. Use a natural language like English Example – problem: compute final course grade 2. Use a mix of natural language and computer language -> pseudocode 3. Use a flowchart 4. In a diagram Example – problem: build a shelving unit 5. In a video (verbal instructions and pictures) Example – problem: make tea

Let’s give it a go! – Take 1 Problem: Solution: Display a greeting on the screen Solution: Algorithm in English Comments Write your 1) header block with a title, a general description of what you’re trying to do, author and date 2) algorithm steps All lines should be preceded by a ________ Code Translate your algorithm into Python using a new addition to our vocabulary: print. Note the parentheses and quotation marks. These are necessary.

Let’s give it a go! – Take 2 Problem:

Why do we need algorithms?

Today’s Review How can I express an algorithm? How would I display 4 + 7 = 12 on the screen? What are the steps we performed when we solve a problem? What do we put in a header? What would print("Above\nBelow") produce on the screen? Give an example of an algorithm?

Next Lecture Introduce Unit 1 – Automation – Chatbots Can we build chatbots using what we know of Python so far, i.e., print, variables, strings input, lists, modules, etc…? We shall see 