Midterm Study Guide PDF

Title Midterm Study Guide
Course INTRO-COMPUT SCI/PROG IN JAVA
Institution Columbia University in the City of New York
Pages 6
File Size 61.9 KB
File Type PDF
Total Downloads 88
Total Views 123

Summary

Midterm study guide ...


Description

Intro to Computer Science in Java – Fall 2017 Midterm Study Guide Terms: 1. accessor method A method that accesses an object but does not change it ie. public String getFirstName(); (String = return type) 2. actual parameter Actual value passed into a method by callers (also called arguments) me.setName(newName); me actual implicit parameter and newName actual explicit parameter 3. Address Unique identifiers of memory cells 4. Algorithm A well-ordered collection of unambiguous and computable operations that, when executed, produces a result and halts in a finite amount of time Made up of input, output and method... 5. Argument Actual parameter… actual input passed into a method 6. arithmetic/Logic Unit (ALU) Subsystem of a computer that performs mathematical and logical operations 7. ASCII American Standard Code for Information Interchange: numerical representation of characters such as a or @, 8 bit characters 8. Binary Use 0 and 1, base 2 system 9. Bit Binary digits: 0 and 1 10. Boolean A binary value with either values of true or false 11. boolean expression A logical statement that is either true or false, put inside parenthesis of loops 12. boolean operator And &&, or ||, not ! (nand) (nor) 13. Byte 8 bits, smallest unit of memory storage 14. cache memory Special memory that is super expensive and fast that uses principle of locality (we will access what we accessed last again soon) to store things we just accessed to make things goe faster Average access time = (cache hit rate x cache average access time) + not cache hit rate (cache access time + ram access time) 15. Cast Taking an object of one type and turning it into another object type 16. Class Blueprint for a data type that makes objects 17. Compiler A program that translates code in a high- level language (such as Java) to machine instructions (such as bytecode for the Java virtual machine). 18. computer science

Study of the principles and uses of computers 19. Constructor Special method for initializing a newly instantiated object, sets up new object by initializing instance variables 20. control unit Runs the show: fetches the instructions, decodes them and executes them 21. Encapsulation The hiding of implementation details via classes

22. explicit parameter Parameters inside the parentheses of a method, things 23. formal parameter Parameters that are used as identifiers and placeholders for things that will be passed into methods, method headers/definitions 24. Gigabyte 230 bits, close to one billion bits 25. I/0 buffer Memory for I/O controller 26. I/O controller Special device that compensates for differences in speeds of input output devices 27. IDE Integrated development environment 28. implicit parameter Parameter that is passed by specifying an object reference before the name of a method 29. Initialize Set a variable to a value when it is created 30. Instance 31. instance variable A variable defined in a class for which every object of the class has its own value Fred.name fred.balance, balance and name are instance variables of fred bank account 32. Instantiation new (keyword), construction of a new object of a class (the object you instantiate is a class)... ie. Rectangle rectangleOne = new Rectangle (23, 94) creates new object of rectangle class named rectangleOne 33. instruction set 34. Kilobyte 10 2 bytes, close to 1000 bits 35. local variable Variable only exists within a certain block 36. logic gate 37. Loop Repetition of block instructions 38. machine language 39. mass storage 40. Megabyte 41. Memory 42. Memory Address Register (MAR) 43. Memory Data Register (MDR)

44. Method A sequence of statements that has a name, may have parameter variables, and may return a value, how people interact with objects 45. mutator method 46. Object An instance of a class, a constructed thing from a class 47. object reference 48. object-oriented programming 49. op code 50. Parameter 51. parameter passing 52. primitive data type 53. Pseudocode Informal way of writing algorithms, in english 54. Random Access Memory 55. Register 56. Scope Part of program where variable is defined/accessible 57. Software 58. stored program concept 59. Syntax 60. Terabyte 61. Transistor on or off state where electricity can flow in on and electricity cannot flow in off 62. truth table 63. Von Neumann architecture 64. white space Topics in Computer Science (Chapters 1-5 in Schneider and Gersting) –What is computer science? –What are algorithms? –Representing algorithms in pseudocode. ● Pseudocode is an informal way of articulating algorithms ● Written in English, modeled to look like statements in a java-like language –Basic algorithmic analysis ● Linear search (sequential search): determines whether a given name x appears on a list ● Binary search: searches a list that is already sorted, checks to see if middle value is equal to wanted value, if wanted value is smaller than middle moves on to check first half of list if wanted value is larger than middle moves on to check first half ○ log2n: tells you how many times you would have to split n into 2 to get last value ● Selection sort: sorts the items of a list into increasing order (1,2,3 or a,b,c), going from right to left, takes largest value of unsorted section and exchanges its position with the last value of the unsorted section, moves marker between unsorted and sorted sections one to the left ● Insertion sort: sorts the items of a list into increasing order, takes value rightmost in the list and compares it to the value of to its left in the sorted section, if the value to its left is greater the greater value gets slid to the right and key gets slid to the left, repeated until the value to the left is smaller than the key and key is inserted, repeated for all values in unsorted section



When comparing the efficiency/quality of algorithms, consider the number of mathematical/logical operations involving variables that are unknown ahead of time that need to be executed ○ A function of the input size n ○ Worst-case and average-case running times ○ Big O notation: considers the order of magnitude of growth –Representing information using bits ● Mantissa: 1101000000100001 ○ 1 (sign of mantissa) (followed by assumed decimal point) ○ 10100000 (Mantissa in 9 bits) ○ 1 (sign of exponent) ○ 00001 (exponent in 5 bits) ● Sound waves representation: ○ Amplitude (height of wave)- measure of loudness ○ Period (time it takes for one complete cycle) ○ Frequency (total number of cycles per unit time)- 1/period, pitch or highness of the sound ○ Sampling: digital representation of sound wave, at fixed intervals value of amplitude is stored an integer ○ Sampling rate and bit depth affect how accurately it can be sampled ● Image representation: ○ Bitmaps– A bitmap is a collection of pixels (picture elements) ○ Black and white can be represented using a single bit ○ – A colored pixel is represented by a 24-bit code of three bytes giving the intensity of red green and blue (RGB). –Circuit construction ● Binary is reliable because only two options means things can either be fully on or fully off ● Transistor: on or off state where electricity can flow in on and electricity cannot flow in off ○ Building block of modern computers ○ Controlled electronically, so small and fast ■ Control aka base (0 open or 1 closes switch) and in inputs, output to emitter (1 on, 0 no off) ● Gate: an electronic device that operates on collection of binary inputs to produce a binary output ● Odd number of 1’s, output = 0, even number of 1’s, output =1 –Introductory computer organization Java programming Skills (Big Java: Chapters 1-6 and Chapter 8) –Variable assignment ● = (assignment operator) sign assigns a value on the right side to a variable on the left side ● ; is like a period, means stop ● == (identity comparator) checks if left side identity is equal to right side identity ● i++ add 1 to i and store the value in i –Primitive data types in Java ● String (String) (***non-primitive data type***): sequence of characters, surrounded by quotes ○ 1 is the numerical value 1, “1” is the string 1 ○ Subclass of Object, has methods ● Scanner (Scanner) (***non-primitive data type***): class for obtaining input from the user

● Integers (int): whole number with no fractional part ● Doubles (double): type of floating point number (when fraction is required) ● Long (long): bigger values than int allows (accompanied by 2) ● Short (short): used for integers ● byte (byte): used for integers ● float (float): type of floating point number (fractional parts) ● Character (char): represents single characters ● Boolean (boolean): true, false value –Control structures ● Conditionals ● Loops ○ while (keyword) loop: while(boolean), executes loop body while boolean is true, when boolean is false it stops, checks boolean after each pass through loop body ■ Good when you want to go until you get a certain value ○ else (keyword) used in if-else statements, else clause is executed if the if condition is false ○ for (keyword): for loop does whatever is in loop body while whatever is in second part is true and continue to repeat and increase as indicated by third part, first part indicates initialization ■ for(i=1; i...


Similar Free PDFs