Welcome to Mario Kart!... Er… EECS 183 Discussion!

Slides:



Advertisements
Similar presentations
Primitive Data Types There are a number of common objects we encounter and are treated specially by almost any programming language These are called basic.
Advertisements

Hand Crafting your own program By Eric Davis for CS103.
Starting Out with C++, 3 rd Edition 1 Chapter 1. Introduction to Computers and Programming.
COSC 120 Computer Programming
Chapter 10.
What Data Do We Have? Sections 2.2, 2.5 August 29, 2008.
Bellevue University CIS 205: Introduction to Programming Using C++ Lecture 3: Primitive Data Types.
© 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5/e Starting Out with C++: Early Objects 5 th Edition Chapter 2 Introduction.
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
Overview of C++ Chapter 2 in both books programs from books keycode for lab: get Program 1 from web test files.
VARIABLES, TYPES, INPUT/OUTPUT, ASSIGNMENT OPERATION Shieu-Hong Lin MATH/CS Department Chapel.
CSC 125 Introduction to C++ Programming Chapter 2 Introduction to C++
CH Programming An introduction to programming concepts.
Input & Output: Console
CS161 Topic #21 CS161 Introduction to Computer Science Topic #2.
CS1 Lesson 2 Introduction to C++ CS1 Lesson 2 -- John Cole1.
CS 114 – Class 02 Topics  Computer programs  Using the compiler Assignments  Read pages for Thursday.  We will go to the lab on Thursday.
Week 1 Algorithmization and Programming Languages.
Array, Pointer and Reference ( I ) Ying Wu Electrical & Computer Engineering Northwestern University ECE230 Lectures Series.
CSC 107 – Programming For Science. The Week’s Goal.
Control Structures (B) Topics to cover here: Sequencing in C++ language.
CS Class 03 Topics  Sequence statements Input Output Assignment  Expressions Read pages Read pages 40 – 49 for next time.
1 COMS 261 Computer Science I Title: C++ Fundamentals Date: September 9, 2005 Lecture Number: 6.
Programming Fundamentals. Overview of Previous Lecture Phases of C++ Environment Program statement Vs Preprocessor directive Whitespaces Comments.
Programming Fundamentals. Summary of previous lectures Programming Language Phases of C++ Environment Variables and Data Types.
CS201 Introduction to Sabancı University 1 Chapter 2 Writing and Understanding C++ l Writing programs in any language requires understanding.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 2-1 Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 3: Input/Output Samples.
2.1 The Part of a C++ Program. The Parts of a C++ Program // sample C++ program #include using namespace std; int main() { cout
Bill Tucker Austin Community College COSC 1315
Discussion #1: “Hello, World!” September 6th, 2016 Kevin Lee (mrkevin)
Elementary Programming Concepts Hannah Westra
Basic concepts of C++ Presented by Prof. Satyajit De
Week 2 - Wednesday CS 121.
EGR 2261 Unit 11 Pointers and Dynamic Variables
Katherine Kampf / kkampf
Chapter 2 Introduction to C++ Programming
Chapter 2: Introduction to C++
Building Java Programs
Computing Fundamentals
Revision Lecture
Chapter 1. Introduction to Computers and Programming
Introduction to C++ October 2, 2017.
Chapter 2: Introduction to C++
IPC144 Introduction to Programming Using C Week 2 – Lesson 1
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Lesson 2: Building Blocks of Programming
CS 1430: Programming in C++ Turn in your Quiz1-2 No time to cover HiC.
Unit 2 Programming.
C++ fundamentals Lecture 1, Chapter 2 – pp /22/2018 Y K Choi.
2.1 Parts of a C++ Program.
Introduction to C++ Programming
Programming Funamental slides
Programming Funamental slides
Building Java Programs
Chapter 3 Input output.
Building Java Programs
Building Java Programs Chapter 2
CS150 Introduction to Computer Science 1
Chapter 2: Introduction to C++.
CMSC201 Computer Science I for Majors Final Exam Information
Building Java Programs
Primitive Types and Expressions
Unit 3: Variables in Java
Building Java Programs Chapter 2
EECE.3220 Data Structures Instructor: Dr. Michael Geiger Spring 2019
C++ Basics CSci 107. A C++ program //include headers; these are modules that include functions that you may use in your //program; we will almost always.
Presentation transcript:

Welcome to Mario Kart!... Er… EECS 183 Discussion!

OMG I GET TO TALK ABOUT MYSELF! My name is Austin Brehob; you can just call me Austin, unless you are feeling especially adventurous My umich email is abrehob@umich.edu I’m a Junior majoring in CS, looking into Machine Learning and Artificial Intelligence I’m weird as toast-nuggets, so I apologize if my weirdness is too much to handle I love all kinds of games; video games, board games, card games, sports, etc. I sometimes have a hard time hearing, so don’t feel bad if I ask you to repeat what you said (maybe multiple times)

Logistics Office hours are 3:00-8:00 M and W-F; 3:00-6:00 Tuesday in 3rd floor Duderstadt (on North Campus) First part of discussion section will be review of tricky concepts from lecture Second part will be you completing a worksheet in pairs/groups Remaining time will be spent discussion common coding/style mistakes and answering questions

What Are Your Names?

Yay! Meeting people! You will be working with other students a lot in this section, so don’t be shy and meet new people! What is your: Name Year Favorite part about last summer Favorite type of potato (baked, mashed, steak fries, sweet potato fries, etc.)

Important Terminology Algorithm: Set of instructions to solve a problem Pseudocode: An algorithm expressed in your own words Integrated Development Environment (IDE): An application which helps you create/compile code Source Code: An algorithm expressed in a programming language Compiler: Software that turns source code into object code Object Code: 10100111011010001101 (the computer understands how to run this)

MOAR Important Terminology Variable: A piece of code that allows for storage and retrieval of data Reserved words: Words that may not be used as variable names because they have special meanings to the compiler Declaration: int numPotatoes; (sets up space in memory for data) Initialization: numPotatoes = 21763; (sets the variable to a particular value)

Questions?

Tricky Concepts

Size of a Problem One of our goals as programmers is to use efficient algorithms to solve problems. Algorithms that take the same amount of extra time when a new element is added to the input are said to take “n” time Counting people in a room, where it takes 0.5 seconds to count a single person Algorithms that take less and less extra time when a new element is added to the input are said to take “log(n)” time Searching through a dictionary, where it takes 10 seconds to find a page and look at the word

Insertion vs. Extraction Operators Insertion operator: “<<“ Inserts data into an output stream, which displays the information Used with “cout” Extraction operator: “>>” Extracts data from an input stream, which means that it reads data given from user (or a file) Used with “cin”

Memory Much of the data stored on your computer is stored in “memory” The size of data is measured in “bits”, which are just 0’s or 1’s We when talk about memory in lecture/discussion, each spot in memory holds one variable It doesn’t matter what the data type of the variable is! (int, string, bool, etc.) In actuality, different data types take up a different amount of space in memory: Bool: 1 bit Char: 8 bits Int: 32 bits Double: 64 bits String: Depends on how many characters

Special Characters Characters can be more than just letters and numbers Does this look familiar?: cout << “Hello World!\n”; The ‘\n’ is a SINGLE CHARACTER, despite looking like two You’ll probably only see ‘\n’ and maybe ‘\t’ Almost everyone uses “endl” instead of ‘\n’ Also, remember that characters are in single quotes and strings are in double quotes!

Integer Division vs. Double Division This topic will be covered next lecture, but it was mentioned in a previous lecture, so I will clarify a bit now When you divide two integers, the result will be an integer (rounded down) 5 / 3 = 1 When you divide using one or two doubles, the result will be a double 5.0 / 3.0 = 1.6666666666… 5 / 3.0 = 1.6666666666… 5.0 / 3 = 1.6666666666…

The Modulus Operator Using the ‘%’ will give you the REMAINDER from division It only works with integers “10 % 3” is the same as “What is the REMAINDER of 10 / 3?” 10 % 3 = 1 44 % 4 = 0 67 % 128 = 67

Questions?

Worksheet Time! Please work on the worksheet with 1 or 2 other people Make sure you communicate about equally; don’t have one person doing all the work We will go over the answers once everyone is finished

Common Style Errors from Project 1

File Headers Headers should follow the format: /** * File name * * Your name * Your uniqname * Project title * File description * More file description */ Make sure to have a separate description for EACH file!

Variables Good coding style is ESSENTIAL so that others who read your code can understand it very easily Variable names MUST use either camelCase or snake_case Let’s say we want a variable for the number of cupcakes we want to bake: “cupcakes” is too short because it doesn’t describe what ABOUT the cupcakes the variable represents “numCupcakes” is sufficient “numCupcakesToBake” is better “numCupcakesWeWantToBakeAndServeToFriends” is bad for obvious reasons (it’s WAY too long) Make sure your variable types make sense “int numCupcakes” makes more sense than “double numCupcakes” because you won’t be serving partial cupcakes

Upcoming Deadlines Zyante Chapter 2 Sections 1-15, Chapter 3 Section 1: By lecture on Tuesday Zyante Chapter 3 Sections 2-9: By lecture on Thursday Assignment 1: By 6:00 on Friday

Questions?