Katherine Kampf / kkampf EECS 183 – DISCuSSION 1 Katherine Kampf / kkampf
Take a few minutes to get to know each other!
About Me Senior in CS-LSA Usually attend the 8:30am lecture Office Hours are Tuesday 3-6pm Worked at Microsoft as a PM this summer Favorite areas of CS: security and UX design Ask me about: XCode, Mac OS X, interviews/internships/resumes, women in STEM, HKN, working for a big tech company, Parks and Recreation
Discussion Format Review of lecture material Sample code/problems Tips for projects and exams Questions and feedback welcome anytime Let me know if you need any special accommodations or if there is anything I can do to improve your course experience!
Office Hours North Campus in the Duderstadt center third floor east side M, W, Th, F 3-8pm and Tues 3-6pm Sometimes additional hours posted on the website Paper signup sheet Schedule posted online OH start and end when they say they do!
Upcoming Dates Assignment Due Zynate readings Before each lecture This Friday 9/16 6pm Project 1 Friday 9/23 6pm
IDEs and Program Basics We support Xcode and Visual Studio Detailed installations and project startup instructions on the website Don’t forget to check out the style guide eecs183.org/vs eecs183.org/xcode
IDEs and Program Basics IDEs provide a code editor where you write and edit code This code is sent to a compiler The compiler turns your code into object code
What is an algorithm? Specific series of steps used to solve a problem Counting people in a room Making pasta Finding a page in a book Algorithms vary in efficiency and speed You’ll learn more about this in EECS 203 and 280
Which of these are reserved words? Reminder: reserved words are key words reserved by C++ that have specific meanings and can’t be used as variable names
cout and cin cout prints to standard output You always need to add #include <iostream> at the top of your file when using these! This allows access to the iostream library which holds the cin and cout operations cout << cin >> cout prints to standard output cin reads input from the user
Variables An element in code that has a specific type and holds or stores values Use descriptive names with these! Can’t be reserved words type name value bool isHungry = true;
Data Types Type What is it? Examples int Whole number 6, 42 double Decimal numbers 5.3, 6.0 char Single character, denoted by single quotes ‘d’, ‘0’, ‘g’, ‘$’ string Collection of multiple characters, denoted with double quotes “Go Blue!”, “EECS 183 rox” bool Holds values true and false false (0), true (1 and any other non-zero number)
Sample Program #include <iostream> #include <string> using namespace std; int main (){ cout << “Enter your name: “ << endl; string users_name; cin >> users_name; cout << “Hello “ << users_name << “!”; cout << endl; return 0; } Output: Enter your name: Katherine Hello Katherine!
Operations and Operators + - / % * = -order of operations applies
Operations with different types Types matter in operations! Dividing an integer by an integer results in an integer 3 / 2 = 1 The result is truncated down Dividing an integer by a double or vice versa results in a double 3 / 2.0 = 1.5 6.8 / 2 = 3.4
Modulus Operator % This operator gives you the remainder of a division 5 % 2 = 1
Modulus Operator % This operator gives you the remainder of a division 5 % 2 = 1 Think about how many times the second number goes into the first 2 % 5?
Modulus Operator % This operator gives you the remainder of a division 5 % 2 = 1 Think about how many times the second number goes into the first 2 % 5? 2! Since 2 does not go into 5 at all, you’re left with the original number
Tips for Success Post on Piazza Start early (the CS mantra) Plan before you code Work with friends Use whiteboards Don’t stress! You’ll do great
Questions? Assignment Due Zynate readings Before each lecture This Friday 9/16 6pm Project 1 Friday 9/23 6pm kkampf@umich.edu