Prof. Matthew Hertz WTC 207D /
Objectives Met in CSC107 Develop solution over entire software lifecycle Implement & test computational solutions Know operational details of computers Perform Boolean logic Describe binary representation of data
High-level Objectives Learn how we solve problems using a computer For this course, focus on scientific problems Logical, methodical process used to write algorithms Learn to master basics of software development C/C++ concepts used by most programs Skills needed to find & fix errors in code
High-level Objectives Learn how we solve problems using a computer For this course, focus on scientific problems Logical, methodical process used to write algorithms Learn to master basics of software development C/C++ concepts used by most programs Skills needed to find & fix errors in code
High-level Objectives Learn how we solve problems using a computer For this course, focus on scientific problems Logical, methodical process used to write algorithms Learn to master basics of software development C/C++ concepts used by most programs Skills needed to find & fix errors in code Have fun
High-level Objectives Learn how we solve problems using a computer For this course, focus on scientific problems Logical, methodical process used to write algorithms Learn to master basics of software development C/C++ concepts used by most programs Skills needed to find & fix errors in code Have fun
High-level Objectives Learn how we solve problems using a computer For this course, focus on scientific problems Logical, methodical process used to write algorithms Learn to master basics of software development C/C++ concepts used by most programs Skills needed to find & fix errors in code Have fun
Expectations of Me Lectures prepared and organized Give interesting, thoughtful, fun problems Be (reasonably) available to answer questions Be honest and forthright
Expectations of Me Lectures prepared and organized Give interesting, thoughtful, fun problems Be (reasonably) available to answer questions Be honest and forthright
Why Most Classes Suck
Teaching Style
Adult Learning Students read material before class Answer initial questions at start of class (Short) lecture explains key ideas Provides 2 nd opportunity to see material Limits long, boring droning Students work in teams to solve problems Make sure you actually understand material Easy to correct when mistakes made early
Expectations of You Work hard Come to class prepared Support & help all your teammates Ask for help early and often Let me know what you are thinking
Attendance Attendance is mandatory 6 Can miss up to 6 classes without penalty 2 From final grade 2 points lost for each add’l absence If you know you will miss class, talk to me ASAP You are responsible for every class Missing class is never acceptable excuse Best way to earn a poor grade: skip class
Deadlines Have 2 virtual “extensions” Each provides a 1 day extension on assignment Can use both on 1 assignment for 48-hour extension Late work not accepted without extension If you know you cannot make a deadline, talk to me Earlier we talk, the better we can find a solution
Grading Philosophy Grades reflect student's demonstrated ability Not a competition where grades are relative I will quite happily give "A" to entire class if all earn it "A" not automatically given to highest score in class Remain fair for students past, present, & future When in doubt, I consider what would be most fair Hard work alone insufficient to raise a score Working efficiently important life skill to be rewarded
Grading Philosophy Doctor Who Cures YouDoctor Who Works Hard Would you rather have:
Course Grading Midterm20% Final35% Projects24% Weekly Assignments12% Daily Activities9% Grades available via Angel Midterm given on Oct. 21 st 3 programming projects during semester
Course Grading Goals Build skills used by “real” programmers Lots of opportunities to learn & improve Present material in variety of ways Develop understanding needed for later classes Catch and correct problems early
Course Grading Goals Build skills used by “real” programmers Lots of opportunities to learn & improve Present material in variety of ways Develop understanding needed for later classes Catch and correct problems early I am mean & like watching students suffer
Weekly Assignments Posted on Angel each week Usually due by 5PM following Tuesday Virtual extensions okay to use on all but first one Before submitting, ask me questions you still have Several goals for these assignments Provide additional programming opportunities Reinforce material from each lecture Questions should seem easy & take under 10 min. Means you are doing well
PowerPoint Slides Students need to take notes on their own Writing increases odds of remembering ideas Really, really bad idea to not take notes Trapped me into specific way of lecturing Limited opportunities to use clever memory tools Lectures often resembled
Students During Lecture
Workings of My Slides Slides contain many pictures, little text Lectures interesting & fun (or at least better) Provides you with good way to reinforce lessons Will suck as actual notes Print slide handout & take notes on the side Write down what the steps shown in animations Slides (with notes) usable on tests, labs, class… Win-win proposition (Except for the lazy ones of you…)
Collaboration Fellow students are a great resource Provides multiple viewpoints & understandings Get together, discuss material, and study Can have them answer lingering questions Clarify assignment and what it requires Learn and practice some basic social skills
Collaboration Work you submit must be done by you When discussing homework or projects Leave conversation with memories only Wait 15+ minutes before starting on your own Solutions always unique after waiting Once started, each student should work alone When in doubt, ask me
Textbook Albert & Breedlove, C++: An Active Learning Approach, Jones & Bartlett, Areas of C++ overlapping C will be course focus Will go through most of the textbook Hit all key concepts you will need for future work Book also excellent resource to look back on
Angel Pages Pages for course found on Angel Handouts, slides, assignments posted before class Can also find solutions after work is due May not include everything said in class Better than nothing, but worse than being here!
Positional Notation Used in nearly all modern numerical systems Right-to-left ordering of digits within larger number Expresses value using value of each digit (0, 1, 2, … 9) Value of position in which the digit is places e.g., 3, 13, 913, 0913, 10913, Numbers & arithmetic easy to understand Subtracting roman numerals is not for faint-of-heart
Positional Notation for = 2 ones= 2 * 1 =2
Positional Notation for = 2 ones= 2 * 1 =2 6= 6 tens= 6 * 10 =60
Positional Notation for = 2 ones= 2 * 1 =2 6= 6 tens= 6 * 10 =60 8= 8 hundreds= 8 * 100 =800
Positional Notation for = 2 ones= 2 * 1 =2 6= 6 tens= 6 * 10 =60 8= 8 hundreds= 8 * 100 =800 5= 5 thousands= 5 * 1000 =5000
Positional Notation for = 2 ones= 2 * 1 =2 6= 6 tens= 6 * 10 =60 8= 8 hundreds= 8 * 100 =800 5= 5 thousands= 5 * 1000 =
Decimal Positional Notation Formal equation for a number d n...d 3 d 2 d 1 d 0 d 0 is digit in ones place, d 1 is in tens place, … d 0 * 10 0 d 1 * 10 1 d 2 * 10 2 d 3 * 10 3 … + d n * 10 n
Base-10 Positional Notation d0d0 2= 2 ones= 2 * 1 =2 d1d1 6= 6 tens= 6 * 10 =60 d2d2 8= 8 hundreds= 8 * 100 =800 d3d3 5= 5 thousands= 5 * 1000 =
Base-10 Positional Notation d0d0 2= 2 ones= 2 * 10 0 =2 d1d1 6= 6 tens= 6 * 10 1 =60 d2d2 8= 8 hundreds= 8 * 10 2 =800 d3d3 5= 5 thousands= 5 * 10 3 =
Base-10 Positional Notation 0d00d0 2= 2 ones 0 = 2 * 10 0 =2 1d11d1 6= 6 tens 1 = 6 * 10 1 =60 2d22d2 8= 8 hundreds 2 = 8 * 10 2 =800 3d33d3 5= 5 thousands 3 = 5 * 10 3 =
Base-10 Positional Notation d0d0 2= 2 ones= 2 * 10 0 =2 d1d1 6= 6 tens= 6 * 10 1 =60 d2d2 8= 8 hundreds= 8 * 10 2 =800 d3d3 5= 5 thousands= 5 * 10 3 =
Computer Number Systems Previous equation worked in decimal (base-10) Usual number system used in day-to-day life System requires representing 10 different digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Computers always in one of two states Turned on, your PS3 can play Guitar Hero 3 Cell phones great paperweights when turned off Binary digits ( 0,1 ) only used by computers To use them, helps to know powers-of-two bases
Digits In Other Bases Binary (base-2) uses 2 digits: 0, 1 Octal (base-8) uses 8 digits: 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal (base-16) has 16 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F A 16 = D 16 = B 16 = E 16 = C 16 = F 16 = 15 10
Positional Notation To convert d n... d 3 d 2 d 1 d 0 into decimal: From base-10 d 0 * 10 0 d 1 * 10 1 d 2 * 10 2 d 3 * 10 3 … + d n * 10 n
Positional Notation To convert d n... d 3 d 2 d 1 d 0 into decimal: From base-b d 0 * b 0 d 1 * b 1 d 2 * b 2 d 3 * b 3 … + d n * b n
Converting Binary to Decimal = d0d0 d1d1 d2d2 d3d3 d4d4 d5d5
Converting Binary to Decimal = d0d0 1* d1d1 1* d2d2 0* d3d3 1* d4d4 0* d5d5 1*
Converting Binary to Decimal = d0d0 1* 2 0 = d1d1 1* 2 1 = d2d2 0* 2 2 = d3d3 1* 2 3 = d4d4 0* 2 4 = d5d5 1* 2 5 =
Converting Hex to Decimal = d0d0 d1d1 3F 16 = d0d0 d1d1
Converting Hex to Decimal = d0d = 7 10 d1d = F 16 = d0d0 F 16 =15 10 d1d = 3 10
Converting Hex to Decimal = d0d = 7 10 * 16 0 = d1d = 2 10 * 16 1 = 3F 16 = d0d0 F 16 =15 10 * 16 0 = d1d = 3 10 * 16 1 =
Positional Notation Review To convert d n... d 3 d 2 d 1 d 0 into decimal: From base-b d 0 * b 0 d 1 * b 1 d 2 * b 2 d 3 * b 3 … + d n * b n
Converting Decimal To Binary Converting from decimal to binary (base-2): While decimal number ≠ 0 Divide decimal number by 2 Move remainder to left end of answer Replace decimal number with quotient =
Converting Decimal To Base-b More generally, convert from decimal to base-b: While decimal number ≠ 0 Divide decimal number by b Move remainder to left end of answer Replace decimal number with quotient = 16
For Next Lecture Mourn summer’s end & start of homework For many, celebrate start of college life Read sections 3.1 – 3.7 & 4.1 – 4.10 for Thurs. Why is main so important for a C program? What are comments & how do we write them? What is a variable and its data type? How can we use variables in a program? How are literals, constants, & variables different?
For Next Lecture Mourn summer’s end & start of homework For many, celebrate start of college life Read sections 3.1 – 3.7 & 4.1 – 4.10 for Thurs. Why is main so important for a C program? What are comments & how do we write them? What is a variable and its data type? How can we use variables in a program? How are literals, constants, & variables different?