MCS 177 Lab Fall 2014 Sept. 2, 2014. GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Contact Info Course Instructor: Louis Yu Lab.

Slides:



Advertisements
Similar presentations
1 C Fundamentals - I Math 130 Lecture # 2 B Smith: Sp05: With discussion on labs, this took 53 minutes. Score 3. Many caveats. B Smith: Sp05: With discussion.
Advertisements

Types and Arithmetic Operators
CSE Spring 2015 INTERMEDIATE PROGRAMMING
Math 1160 – Finite Mathematics and Its Applications Openers.
COMS W1004 Introduction to Computer Science June 1, 2009.
CSI 101 Elements of Computing Spring 2009 Lecture #1 – From Math to Computers Wednesday, January 21, 2009.
Week 2 - Friday.  What did we talk about last time?  Data representation  Binary numbers  Types  int  boolean  double  char  String.
Recitation 1 Programming for Engineers in Python.
1 CS1130 Spring 2011: David Gries & Walker White Transition to Object-Oriented Programming Assumes programming knowledge in a language like Matlab, C,
Lecture 2 - Variables, program execution, calculations, print() COMPSCI 101 Principles of Programming.
CPS 2231 Computer Organization and Programming Instructor: Tian (Tina) Tian.
1 CS1110 Fall 2010 Instructors: David Gries & Lillian Lee CS1112: Matlab No prior programming experience One semester of calculus Math- & engineering-
Course A201: Introduction to Programming 09/09/2010.
Computing with Numbers CSC 161: The Art of Programming Prof. Henry Kautz 9/14/2009.
7 th Grade Math Week of 9/22/14 Information from :
Computer Science 111 Fundamentals of Programming I Overview of Programming.
Agenda  Commenting  Inputting Data from Keyboard (scanf)  Arithmetic Operators  ( ) * / + - %  Order of Operations  Mixing Different Numeric Data.
Chapter 3.  Traditionally, programming languages have assigned different types of data for different types of numbers.  In many languages, there may.
Python Types Python values are of various “types” Ints, Floats, Strings, Characters, and more Two representations of numbers 1 vs 1.0.
PYTHON: PART 2 Catherine and Annie. VARIABLES  That last program was a little simple. You probably want something a little more challenging.  Let’s.
D-1 University of Washington Computer Programming I Lecture 4: Arithmetic Expressions © 2000 UW CSE.
OCR Computing GCSE © Hodder Education 2013 Slide 1 OCR GCSE Computing Python programming 6: Variables and constants.
Input, Output, and Processing
Computer Science 101 Introduction to Programming.
Week 2 - Wednesday.  What did we talk about last time?  Data representation  Binary numbers  Types  int  boolean  double  char  String.
Miss Christina Sayegh Grade 6 St. Martin de Porres School.
Summary of what we learned yesterday Basics of C++ Format of a program Syntax of literals, keywords, symbols, variables Simple data types and arithmetic.
ECE Application Programming Instructors: Dr. Michael Geiger & Nasibeh Nasiri Fall 2015 Lecture 2: Basic C program structure Data in C: Data types,
MCS 270 Spring 2014 Object-Oriented Software Development.
CSC 107 – Programming For Science. The Week’s Goal.
Ministry of Higher Education Sohar College of Applied Sciences IT department Comp Introduction to Programming Using C++ Fall, 2011.
1 CS1100 Fall Instructor: David Gries CS100M: Matlab No prior programming experience One semester of calculus Math & engineering type problems CS100J:
COMP Primitive and Class Types Yi Hong May 14, 2015.
Introduction to Python Dr. José M. Reyes Álamo. 2 Three Rules of Programming Rule 1: Think before you program Rule 2: A program is a human-readable set.
MCS 118 Fall 2013 September 23, GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Announcements Quiz next Monday. If you need accommodations, see me. MCS 118,
Doing math In java.
D-1 University of Washington Computer Programming I Lecture 4: Arithmetic Expressions © 2000 UW CSE.
Python Lesson 1 1. Starter Create the following Excel spreadsheet and complete the calculations using formulae: 2 Add A1 and B1 A2 minus B2 A3 times B3.
MCS 118 Fall 2013 September 26, GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Announcements Quiz next Monday. If you need accommodations, see me. No office.
WELCOME To ESC101N: Fundamentals of Computing Instructor: Ajai Jain
Thinking about programming Intro to Computer Science CS1510 Dr. Sarah Diesburg.
Dr. Sajib Datta Jan 15,  Instructor: Sajib Datta ◦ Office Location: ERB 336 ◦ Address: ◦ Web Site:
1 CS100J Spring Instructor: David Gries CS100M: Matlab No prior programming experience One semester of calculus Math & engineering type problems.
PROBLEM SOLVING AND PROGRAMMING ISMAIL ABUMUHFOUZ | CS 170.
COMPUTER PROGRAMMING Year 9 – lesson 1. Objective and Outcome Teaching Objective We are going to look at how to construct a computer program. We will.
1 09/10/04CS150 Introduction to Computer Science 1 What Actions Do We Have Part 2.
What will each of the following lines print? System.out.println("number" ); number645 System.out.println("number" + (6 + 4)+ 5); number105 System.out.println(6.
CSC Programming for Science Lecture 5: Actual Programming.
Bill Tucker Austin Community College COSC 1315
Thinking about programming
Fundamentals of Programming I Overview of Programming
CMPT 120 Topic: Python’s building blocks -> More Statements
Topic: Python’s building blocks -> Statements
Expressions An expression is a portion of a C++ statement that performs an evaluation of some kind Generally requires that a computation or data manipulation.
Design & Technology Grade 7 Python
Variables, Expressions, and IO
Thinking about programming
IPC144 Introduction to Programming Using C Week 2 – Lesson 1
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:
Lecture 2 Python Programming & Data Types
Arithmetic Expressions & Data Conversions
Computational Thinking through Mechatronics
Core Objects, Variables, Input, and Output
Introduction to Programming with Python
Winter 2019 CISC101 4/28/2019 CISC101 Reminders
Data Types and Maths Programming Guides.
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Arithmetic Expressions & Data Conversions
Introduction to Python
Python Creating a calculator.
Presentation transcript:

MCS 177 Lab Fall 2014 Sept. 2, 2014

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Contact Info Course Instructor: Louis Yu Lab Instructors: Mike Hvidsten Jeff Engelhardt Lab Assistants 11:30: Andrew Haisting 2:30: Dustin Luhmann MCS 177, 9/2/14

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Today’s schedule Course/Lab Details Python and Idle Python Intro (Sec in textbook) Tasks 1 and 2 of Project 1 (if time) MCS 177, 9/2/14

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Course/Lab Course Website: Lectures – Monday, Wednesday, Friday Read Assigned sections before class (see class schedule) Lab Work – Tuesday, Thursday Projects are linked from course site This week – Intro (nothing to hand in) Submit code via Moodle Lab notes/slides at MCS 177, 9/2/14

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Python – Course Programming Language Python is an open source scripting language. Developed by Guido van Rossum in the early 1990s Named after Monty Python Available on MCS computers Available for download from MCS 177, 9/2/14

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Why Python? MCS 177, 9/2/14 Simple Syntax – we can focus on solving problems, learning concepts, not coding syntax Object-Oriented – all values are essentially objects Widely used (Google spider and search engine) Powerful String and Math libraries Dynamic Typing: Variables do not need to have pre- defined types

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Idle GUI Environment: MCS 177, 9/2/14

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Let’s Get Started! Log on to your computer (user name = name) Start Idle Try some basic arithmetic examples MCS 177, 9/2/14

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Arithmetic Operations MCS 177, 9/2/14 OperatorOperation +Addition -Subtraction *Multiplication /Float division //Integer division %Remainder **Exponentiation abs()Absolute value

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Numerical Data Types Integer (int) vs Floating Point (float) How can we tell which is which? A numeric value without a decimal point produces an int value A numerical value that has a decimal point is represented by a float (even if the fractional part is 0) MCS 177, 9/2/14

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Numerical Operations >>> >>> >>> 3.0* >>> 3*4 12 >>> 10.0/ >>> 10/ >>> 10 // 3 3 >>> 10.0 // MCS 177, 9/2/14 Operations on ints produce ints (except for /) Operations on floats produce floats, Mixed operations are converted to floats

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Variable Assignment (Section 1.5) MCS 177, 9/2/14 As in mathematics, much of the power of computer programs is in the use of variables Python variables are identified by name Must start with a letter Ex: x=2, a_1 = x+3

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Example MCS 177, 9/2/14 We want to calculate the volume of a cylinder volume = area of base * height Variables?

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Example MCS 177, 9/2/14

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Diagram for Simple Assignment in Python MCS 177, 9/2/14

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Changing Radius value has no effect on cylinderVolume! Why not? MCS 177, 9/2/

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu How do we make change? MCS 177, 9/2/14 Need to re-evaluate baseArea and cylinderVolume

GUSTAVUS ADOLPHUS COLLEGEgustavus.edu If time, Start working on Tasks 1 and 2 of Project 1 MCS 177, 9/2/14