UMBC CMSC 104 – Section 01, Fall 2016 Exam 1 Review
Notes & Announcements Exam 1 Postponed! Old Date: Next Tuesday, 10/18 New Date: Next Thursday, 10/20 Next Tuesday, the TA will hold a Q&A session during class time Bring your questions about anything that might be on the exam
Hands-on Lab 2 Review
Hands-on Lab Results Most of you got the sum and the product without any problem Most of you were able to calculate the average, but often the decimals were truncated… Some of you got the largest & smallest calculations … but most of you did it the hard way
Calculating the Average Works how you would expect, except… A float multiplied or divided by a float is always a float An integer multiplied or divided by a float is always a float An integer multiplied or divided by an integer is always an integer Even you’re storing the result in a float variable!
Dividing Integers & Floats
Output of Previous Slide An Integer divided by an Integer: 2.000000 An Integer divided by a Float: 2.500000
Finding the largest and smallest Many ways to do this Compare each number to the others Gets kind of complicated Potentially lots of nested ifs We haven’t covered “complex” comparators like && yet A loop Also complicated Just add another variable!
Finding the largest and smallest
Lab 2 I posted two more files to the sample directory stats.c – My “answer” to lab 2, which was used to create the sample output division.c – The division sample we went over when discussing averages Any other questions on this?
Exam 1 Review
Overview If it’s in the slides, it’s fair game Broad Concepts Generally, concepts more important than specifics Broad Concepts Machine Architecture (parts of a computer) Data Storage Concepts Number Systems (Hex, Binary, Decimal) OS Concepts & Linux Algorithms & Algorithm Concepts C Basics (i.e. what we’ve covered so far)
Machine Architecture Content Creation vs Consumption Computer components CPU, GPU, ALU, etc Speed & Storage measurements MHz, GHz, etc MB, GB, etc Volatile vs Non-volatile Serial vs Parallel
Data Storage Concepts Bits & Bytes Data Sizes (see table)
Number Systems Binary Hex Conversions Binary to Decimal Decimal to Binary Hex to Decimal Decimal to Hex Hex to Binary Binary to Hex
OS Concepts & Linux What is an OS Ways to interact with an OS Linux Files & Directories Frequently used commands See slides Know how to traverse the directory structure, create and delete files, etc
Algorithms & Algorithm Concepts Definition of an algorithm Characteristics of an algorithm Pseudocode Concepts
C Basics Stages of compilation A basic C program template Hello world! Preprocessor directives for symbolic constants #define Legal Variable Identifiers Declaring variables Variable types int, float, char Basic printf() and scanf() usage
Questions?