CS 1111 Introduction to Programming Spring 2019

Slides:



Advertisements
Similar presentations
Programming TBE 540 Farah Fisher. Objectives After viewing this presentation, the learner will be able to… Given a task, create pseudocode Given pseudocode,
Advertisements

LECTURE 1 CMSC 201. Overview Goal: Problem solving and algorithm development. Learn to program in Python. Algorithm - a set of unambiguous and ordered.
Creating Computer Programs lesson 27. This lesson includes the following sections: What is a Computer Program? How Programs Solve Problems Two Approaches:
Chapter 2: Developing a Program Extended and Concise Prelude to Programming Concepts and Design Copyright © 2003 Scott/Jones, Inc.. All rights reserved.
Chapter 1 Program Design
Copyright © 2006 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Technology Education Copyright © 2006 by The McGraw-Hill Companies,
Chapter 3 Planning Your Solution
PRE-PROGRAMMING PHASE
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
1 Integrated Development Environment Building Your First Project (A Step-By-Step Approach)
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.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Developing a Program.
Simple Program Design Third Edition A Step-by-Step Approach
Introduction to Computational Linguistics Programming I.
Introduction to Programming Peggy Batchelor.
Chapter 1 Introduction. Goal to learn about computers and programming to compile and run your first Java program to recognize compile-time and run-time.
Chapter 1 CSIS-120: Java Intro. What is Programming?  A: It is what makes computer so useful.  The flexibility of a computer is amazing  Write a term.
Python – Part 1 Python Programming Language 1. What is Python? High-level language Interpreted – easy to test and use interactively Object-oriented Open-source.
Python From the book “Think Python”
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
Problem Solving using the Science of Computing MSE 2400 EaLiCaRA Spring 2015 Dr. Tom Way.
Cs413_design04.ppt Design and Software Development Design : to create a functional interface that has high usability Development : an organized approach.
Review, Pseudocode, Flow Charting, and Storyboarding.
1 Program Planning and Design Important stages before actual program is written.
You Need an Interpreter!. Closing the GAP Thus far, we’ve been struggling to speak to computers in “their” language, maybe its time we spoke to them in.
How to Program? -- Part 1 Part 1: Problem Solving –Analyze a problem –Decide what steps need to be taken to solve it. –Take into consideration any special.
CSC 1010 Programming for All Lecture 2 Introduction to Python Some material based on material from Marty Stepp, Instructor, University of Washington.
1 Overview of Programming Principles of Computers.
Introduction to Computers Lesson 13A. home Computer Program A set of instructions or statements, also called code, to be carried out by the computer’s.
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 1 An Introduction to Visual Basic.NET and Program Design.
Chapter 2 Build Your First Project A Step-by-Step Approach 2 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
PROBLEM SOLVING WARM-UP Fill in the spaces using any operation to solve the following (!, (), -/+,÷,×): = 6.
Introduction to Algorithm. What is Algorithm? an algorithm is any well-defined computational procedure that takes some value, or set of values, as input.
Software Development Environment
Basic Concepts: computer, program, programming …
What Do Computers Do? A computer system is
Chapter 1 – Introduction
Development Environment
CST 1101 Problem Solving Using Computers
A Python Tour: Just a Brief Introduction
Topic: Programming Languages and their Evolution + Intro to Scratch
Topics Introduction Hardware and Software How Computers Store Data
Key Ideas from day 1 slides
2008/09/22: Lecture 6 CMSC 104, Section 0101 John Y. Park
Topics Introduction to Repetition Structures
Programming Mehdi Bukhari.
Pseudocode Upsorn Praphamontripong CS 1110 Introduction to Programming
Transition to Code Upsorn Praphamontripong CS 1110
Algorithm and Ambiguity
Transition to Code Upsorn Praphamontripong CS 1111
An Introduction to Visual Basic .NET and Program Design
Unit# 8: Introduction to Computer Programming
Computer Programming.
Unit E Step-by-Step: Programming with Python
For -G7 programing language Teacher / Shamsa Hassan Alhassouni.
Introduction to Algorithm Design
Topics Introduction Hardware and Software How Computers Store Data
Programming.
Algorithm and Ambiguity
Creating Computer Programs
Click to add Text Computers & Instructions. Computers are given instructions in the form of computer programs that are created through the development.
ICT Programming Lesson 1:
ICT Gaming Lesson 2.
CS 101 Test 2 Review.
Chapter 1: Programming Basics, Python History and Program Components
Creating Computer Programs
WJEC GCSE Computer Science
Programming Logic and Design Eighth Edition
Presentation transcript:

CS 1111 Introduction to Programming Spring 2019 Transition to Code CS 1111 Introduction to Programming Spring 2019

Pseudocode review Pseudocode is one of the methods that can be used to represent / describe an algorithm (usually in English) Not use specific programming language syntax Can be easily translated into a high-level programming language Usually include terms specifying a sequence of actions the a program will take Each line does one thing -- must be executable

Control Structures Sequence Condition ( if ) Repetition ( loop ) review Sequence A series of statements that execute one after another Condition ( if ) To decide which of the two or more different statements to execute depending on a certain condition Repetition ( loop ) To repeat statements while certain conditions are true Subprogram / named action A small part of another program solving a certain problem A collection of subprograms solves the original problem

Example Problem: Flowcharts Pseudocode A company is planning to have a storewide sale of 20% Sales tax is 5% You enter the price of an item based on the price tag Calculate the final sale price of an item after applying the discount and the sales tax Display the final sale price Flowcharts Pseudocode Get item price Apply 20% discount Add 5% sales tax Display final sale price

Example: Rewrite Pseudocode Test the pseudocode with some simple inputs Let item price = 100 Does the pseudocode work as expected? final sale price = 84 If yes, let’s test with more inputs item price = 0 item price = -100 Does it still work? Always test the pseudocode and rewrite until it works properly 1. Get item price 2. Apply 20% discount 3. Add 5% sales tax 4. Display final sale price rewrite 1. Get item price 2. Check if price is <= 0, then repeat step 1 3. Apply 20% discount 4. Add 5% sales tax 5. Display final sale price

Python Interpreted programming language Has simply syntax – easy to read Has most of the features of traditional programming languages Supports a wide range of programs: games, web apps, system administration Used by many successful companies: Google, IBM, Disney, EA Games Open source Three types: console, GUI, web app

How Python Compiles and Runs Source Code Step 1: Programmer uses an editor to write source code code (.py) 1. Get item price 2. Check if price is <= 0, then repeat step 1 3. Apply 20% discount 4. Add 5% sales tax 5. Display final sale price Step 2: Source is compiled by the interpreter into bytecode Python interpreter Interpret at runtime (Python 3.6) Executable version (.pyc) Step 3: Bytecode is translated by the Python virtual machine into instructions that can interact with the operating system of the computer

Project management window PyCharm Integrated Development Environment (IDE) Several ways to run Click the “run” icon Select the “Run” menu option Right click on editor window and select “Run <filename>” Right click on the file name and then select “Run” Project management window (“project view”) Editor window (“editor”) Execution window (“console”)

Include Name and ComputingID To automatically include your name and computingID when creating a new Python file For Mac Select PyCharm menu Select Preferences Select Editor option Select File and Code Templates option Select Python Script Type your name and computingID Click OK Type your name and computingID here

Include Name and ComputingID To automatically include your name and computingID when creating a new Python file For Window Select File menu Select Setting Select Editor option Select File and Code Templates option Select Python Script Type your name and computingID Click OK Type your name and computingID here

Additional Resources PythonTutor http://pythontutor.com/visualize.html#mode=edit