Elementary Programming Concepts Hannah Westra

Slides:



Advertisements
Similar presentations
CSE202: Lecture 2The Ohio State University1 Variables and C++ Data Types.
Advertisements

What Data Do We Have? Sections 2.2, 2.5 August 29, 2008.
1 9/10/07CS150 Introduction to Computer Science 1 Data Types Section 2.7 – 2.12 CS 150 Introduction to Computer Science I.
Your First C++ Program Aug 27, /27/08 CS 150 Introduction to Computer Science I C++  Based on the C programming language  One of today’s most.
1 9/20/06CS150 Introduction to Computer Science 1 Review: Exam 1.
If You Missed Last Week Go to Click on Syllabus, review lecture 01 notes, course schedule Contact your TA ( on website) Schedule.
CS31: Introduction to Computer Science I Discussion 1A 4/2/2010 Sungwon Yang
CS150 Introduction to Computer Science 1
1 8/30/06CS150 Introduction to Computer Science 1 Your First C++ Program.
Libraries Programs that other people write that help you. #include // enables C++ #include // enables human-readable text #include // enables math functions.
Admin Office hours 2:45-3:15 today due to department meeting if you change addresses during the semester, please unsubscribe the old one from the.
VARIABLES, TYPES, INPUT/OUTPUT, ASSIGNMENT OPERATION Shieu-Hong Lin MATH/CS Department Chapel.
CS161 Topic #21 CS161 Introduction to Computer Science Topic #2.
ECE 264 Object-Oriented Software Development Instructor: Dr. Honggang Wang Fall 2012 Lecture 4: Continuing with C++ I/O Basics.
CS 114 – Class 02 Topics  Computer programs  Using the compiler Assignments  Read pages for Thursday.  We will go to the lab on Thursday.
Agenda Review C++ Library Functions Review User Input Making your own functions Exam #1 Next Week Reading: Chapter 3.
Semester Review. As we have discussed, Friday we will have in class time for you to work on a program, this program will come with instructions and you.
C++ Programming: Basic Elements of C++.
Fundamental Programming: Fundamental Programming Introduction to C++
CSC 107 – Programming For Science. The Week’s Goal.
CSC1201: Programming Language 2 Lecture 1 Level 2 Course Nouf Aljaffan (C) CSC 1201 Course at KSU1.
CSC 107 – Programming For Science. Announcements.
Introducing C++ Programming Lecture 3 Dr. Hebbat Allah A. Elwishy Computer & IS Assistant Professor
1 COMS 261 Computer Science I Title: C++ Fundamentals Date: September 9, 2005 Lecture Number: 6.
Data Tonga Institute of Higher Education. Variables Programs need to remember values.  Example: A program that keeps track of sales needs to remember.
Fundamental Programming Fundamental Programming More Expressions and Data Types.
12/14/2016CS150 Introduction to Computer Science 1 Announcements  Website is up!   All lecture slides, assignments,
Chapter 2 Creating a C++ Program. Elements of a C++ Program Four basic ways of structuring a program Four basic ways of structuring a program 1.Sequencing.
1 8/30/06CS150 Introduction to Computer Science 1 Your First C++ Program.
Lecture 3: More Java Basics Michael Hsu CSULA. Recall From Lecture Two  Write a basic program in Java  The process of writing, compiling, and running.
Welcome to Mario Kart!... Er… EECS 183 Discussion!
ENGINEERING 1D04 Tutorial 1. WELCOME! What we’re doing today Who am I How to do well What are computer programs Software Development Cycle Pseudo Code.
Bill Tucker Austin Community College COSC 1315
Discussion #1: “Hello, World!” September 6th, 2016 Kevin Lee (mrkevin)
Discussion 4 eecs 183 Hannah Westra.
EECS 183.
CMSC201 Computer Science I for Majors Lecture 03 – Operators
Katherine Kampf / kkampf
Jie(Jay) Wang Week1 Sept. 30
CMSC201 Computer Science I for Majors Lecture 04 – Expressions
Introduction to C++ Programming Language
Chapter 2 - Introduction to C Programming
CMSC202 Computer Science II for Majors Lecture 08 – Overloaded Constructors Dr. Katherine Gibson Based on slides by Chris Marron at UMBC.
Introduction to C++ October 2, 2017.
Chapter 2 - Introduction to C Programming
CMSC201 Computer Science I for Majors Lecture 27 – Final Exam Review
Elementary Programming Concepts Andrew (amwallis)
CMSC201 Computer Science I for Majors Lecture 03 – Operators
CS 240 – Lecture 11 Pseudocode.
Chapter 2 - Introduction to C Programming
Introduction to C++ Programming
Chapter 2 - Introduction to C Programming
TIPS: How to Be Successful
CS150 Introduction to Computer Science 1
Variables T.Najah Al_Subaie Kingdom of Saudi Arabia
Wednesday 09/23/13.
Chapter 2 - Introduction to C Programming
Building Java Programs
Engineering Problem Solving with C++ An Object Based Approach
Engineering Problem Solving with C++ An Object Based Approach
CMSC201 Computer Science I for Majors Final Exam Information
Arithmetic Operations
Chapter 2 - Introduction to C Programming
EECE.3220 Data Structures Instructor: Dr. Michael Geiger Spring 2017
Winter 2019 CISC101 4/28/2019 CISC101 Reminders
EECE.3220 Data Structures Instructor: Dr. Michael Geiger Spring 2019
Introduction to C Programming
Week 7 - Monday CS 121.
Introduction to Python
Presentation transcript:

Elementary Programming Concepts Hannah Westra hmwestra@umich.edu EECS 183 Elementary Programming Concepts Hannah Westra hmwestra@umich.edu

About Me: Junior majoring in Computer Science, minoring in Science, Technology, & Society First Semester as EECS 183 IA Had never programmed before 183 EECS Courses I’ve taken: 183, 203, 280, 281, 398, 370, 485 Chair of Project Flavor at the University and Interned for a Food App Last Summer

Take 2-3 minutes to get to know your neighbors Your Turn! Name, Year Take 2-3 minutes to get to know your neighbors

Discussion Format: Review of material covered in Lecture Practice problems/code similar to project concepts and problems you will see on the exam Tips for Testing and Projects Come with questions! I would love to answer any and all questions you have Any feedback is appreciated!

Class Logistics: If you have a question, check piazza first – someone probably already asked it! If not, post a question! Next step is to go to office hours – check the website There are at least 3 hours of office hours every day DON’T CHEAT! It’s actually a much bigger deal than you might think, and the smallest infraction can result in major consequences

Office Hours Office hours will be held on North Campus in the Duderstadt center, starting next Monday. There will always be office hours from: 3-6 pm Tuesdays, and 3-8 pm M, W-F on the third floor, east end (diagram on next slide) There will sometimes be additional office hours on the weekend – the will be posted on the website There will be a paper sign up sheet that will arrive with the first staff member, and they will start promptly at 3, and end exactly at 8 (give or take 5 minutes) The website will indicate which staff members are present at which time, and this will remain mostly consistent

Meet the Staff! Meet the staff and help with getting your laptop ready Sunday, September 11th 1800 Chemistry Building Bring your laptop! Stay posted on the website for more info

Upcoming Due Dates: Zyante reading – due before each lecture Assignment 0: This Friday, September 9th at 11:59 pm Assignment 1: Friday, September 16th at 11:59 pm Always check the website for updates

Xcode vs. Visual Studio What is an IDE? Integrated Development Environment Xcode and Visual Studio are just a couple examples I work with Xcode If I can’t help you with a Visual Studio question, I will find someone who can!

Basics of Programming You will write your programs in an IDE (Xcode or Visual Studio) These provide a code editor (where you write and edit code) The code you write is sent through a compiler The compiler turns your code into object code (machine language) Compiler is software which takes the source code to object code Machine language = binary (1s and 0s) Source code compiler object code

What Is An Algorithm?

What is an algorithm? A specific approach to solve a problem Counting people in a room (you did this in lecture) Finding a certain page in a book Picking teams with captains Different algorithms vary in efficiency and speed You’ll learn more about this in EECS203 and 281 if you choose to take them By halving the problem each time we vastly improve the search through the book

Questions? Pseudocode? Loops Conditions Difference between pseudocode and source code Code editor Compiler Object code (370) Return type Semicolons Cout cin Endl #include Using namespace std Variables Data types Operators Int division modulo

Any Reserved Words?

cin and cout To use these program calls we need to add: #include <iostream> at the top of our program This allows us access to the iostream library from which the operations cin and cout come from

cin and cout What does cout do? cout << “Hello World!”;

cin and cout What does cout do? Call to a function that prints output to standard output

cin and cout What does cout do? Prints output to standard output What does cin do? cin >> defined_variable;

cin and cout What does cout do? Call to a function that prints output to standard output What does cin do? Call to a function that reads input in from the user

Data Types What is a double? An int? What is a char? What is a string? 5.0 is a double type, 5 is an int type What is a char? ‘a’, ‘k’  denoted by single quotes What is a string? A collection of characters (chars) “hello”, “me”, “a”  denoted by double quotes What is a bool? Holds value true or false

Binary and Boolean values The most important thing to remember: 0 is false 1 is true Any number that isn’t 0 is also true Look online and in lecture for more details about binary code and binary/decimal numbers If (3) would evaluate as true always On board: Bring back to if (result == true) – walk through it, show how the computer reads it, and why its extra work – correct it

What is a variable? int result = 0; A element in code that has a specific type, and holds or stores values in memory int is the type of the variable

Variable Naming and Initializing Always initialize your variable to 0, or its initial value The variable should have a descriptive name Case-sensitive int result vs. int Result Start with a letter or underscore Make sure your variable is not a reserved word Check the lecture slides and resources on the website for more details Initialization is important to avoid garbage values Xcode and Visual Studio automatically initialize to 0, but the autograder will not! After first letter, use any combo of letters, numbers, and underscores as long as not reserved word Only alphanumeric and underscores!!

Sample Program:

Operations and Operators + - / % * =

Modulus Operator: % What does it do?

This operator gives you the remainder of a division Modulus Operator: % This operator gives you the remainder of a division What is 5 % 2?

Modulus Operator: % This operator gives you the remainder of a division What is 5 % 2? 1 Think about: how many times does the second number go into the first?

Modulus Operator: % This operator gives you the remainder of a division Think about: how many times does the second go into the first? What is 2 % 5?

Modulus Operator: % This operator gives you the remainder of a division Think about: how many times does the second go into the first? What is 2 % 5? 2 If it doesn’t go in at all, you are left with the first number (you couldn’t do anything with it)

How to Succeed in 183: Post on Piazza a lot (questions and answers) Start Projects early (as soon as they come out) and go to office hours! Plan before you code! Work with others – talk through the logic out loud There is nothing more helpful than teaching others something you just learned Work with whiteboards

Feel Free to Stay and Ask Questions! Last Minute Reminders: Zyante reading – due before each lecture Meet the Staff! This Sunday, September 11th at 6pm in 1800 CHEM Assignment 0: This Friday, September 9th at 11:59 pm Assignment 1: Friday, September 16th at 11:59 pm Feel Free to Stay and Ask Questions!