DOC PREVIEW
UB CSE 115 - Exam 1 Study Guide

This preview shows page 1-2-3 out of 9 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CSE 115 1st EditionExam # 1 Study Guide Lectures: 1 – 9Lecture 1 (1/30)What is 10110 as a base 10 number? Base 2 number?10110 represents 10110 as a base 10 number.As a base 2 number… 1 0 1 1 0 _____ _____ _____ _____ _____1*(2^4) + 0*(2^3) + 1*(2^2)+ 1*(2^1) + 0*(2^1) = 16 + 0 + 4 + 2 + 0 = 22Lecture 2 (2/2)AND GateInput 1 Input 2 Output0 0 00 1 01 0 01 1 1OR GateThese notes represent a detailed interpretation of the professor’s lecture. GradeBuddy is best used as a supplement to your own notes, not as a substitute.Input 1 Input 2 Output0 0 00 1 11 0 11 1 1NOT GateInput Output0 11 0- 4 gates hold 1 binary digit (bit)- 8 bits = 1 byte- 1024 bytes = 1 kilobyte- 1000000 bytes = 1 megabyte- 1000000000 bytes = 1 gigabyteLecture 3 (2/4)Computer Organization- Memory- Central Processing Unit (CPU)o Arithmetic Logic Unit (ALU)o Registers General Register (R1-R16) Special Purpose Registers (Program Counter [PC], Instruction Register [IR])Translation- Assembly (Assembly language to Machine language [low level language to low level language])- Compilation (High level language to low level language)Lecture 4 (2/6)Create an object new example1.Terrarium ()________ ___________________________ _____ 1 2 31. Operator- finds available space for representation2. Expression- language that has value3. Argument List *This code produces a value and as a side effect creates and initializes an object.*The starting address of the memory location of the object = the value of the expression = referenceLecture 5 (2/9)IDE = Integrated Development Environment (i.e. Eclipse)new example1 . Terrarium()_____ _____________ _______________ 1 2 31. Operator- produces value (reference), creates object2. “Package”- folder3. File (within package)Lecture 6 (2/11)Call a Method new example1. Terrarium(). addChicken(new example1.Chicken())________________________________ _ _____________ ______________________________ 1 2 3 41. Expression2. “Member Access Operator”3. Name of Method 4. Argument ListVariables have:- Name - Location - Type - Value- Scope- LifetimeVariable Declaration- Specifies encoding scheme and size- Consists minimally of type (a class) and name- Ex: o example1.Terrarium t;o example1.Chicken c;Variable Assignment- Variable is assigned to expression- Variable = expression- t = new example1.Terrarium();- ‘=’ is an assignment operator- Assignment statement is evaluated right to lefexample1.Terrarium t;t = new example1.Terrarium();example1.Chicken c;c = new example1.Chicken();t.addChicken(c);Lecture 7 (2/13) Object Diagramexample1.Chicken t cLecture 8 (2/16)- Class definition- description of the properties and behaviors that instances of the class will have example1.Terrariumname of classnew example1.Terrarium()argument listclass constructor – initializes the state of the new objectpackage nameoperator“reserved word”Defining a Classpackage lab2;public class BarnYard {public BarnYard() {}}- Bolded words are reserved words- First line = package declarationo Package name (lab2) is chosen; no capital letters- Second line (before the brace) = class header- Third, Fourth, Fifh line + first brace = class body- Class header + class body = class definitionClass Header public class BarnYard- Made up of:o Access control modifier (public)o Reserved word (class)o Class name (BarnYard [starts with capital letter and every word afer starts with a capital letter])Class Body (aka Constructor Definition)constructor call{public BarnYard() {}}- Made up of:o Control access modifier (public)o Constructor name (always same as class name)o Parameter list (())o Body (everything between the second and third braces)Lecture 9 (2/18)Composition – whole-part relationship- Whole and part have same lifetime- When whole is destroyed, parts also go awayLocal Variable- Declared within the constructor - Scope of local variables is from its declaration to end of the constructor definitionInstance Variable- Declared within the class body (BEFORE the constructor header)- Scope of instance variable is the entire class bodypackage example;public class Dog {private Tail _tail;public Dog() {_tail = new Tail();example1.paw p;p = new example1.paw();_tail = instance variablep = local variableMemory Organization- Within a process in the computer memory there are 2 sections of memory- Static Memory is where the machine language instructions are stored- Dynamic Memoryo Stack- where local variables are heldo Heap- where instance variables are held (or anything allocated by


View Full Document

UB CSE 115 - Exam 1 Study Guide

Download Exam 1 Study Guide
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Exam 1 Study Guide and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Exam 1 Study Guide 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?