Review Sheet CS 110 Exam 1 Friday 2 21 2020 Chapters 1 2 4 static methods I Chapter 1 All Sections A Terms Hardware Main Memory Binary Compiler Syntax error Binary Digit bit Compiler B Software CPU Secondary Storage Machine Code High Level Programming Language Interpreter Hybrid Interpreter logic error Algorithm byte word Interpreter Topic Understand the basic outline and structure of a Java program Why is the main function important You should know how to use print and println You need to know how to convert an integer number to binary Given an invocation of a method ie System out println Hi You should recognize that System out refers to an object println a method and that Hi is a argument to the println method o What is the importance of System out and System in what do they refer to o You should be able to recognize syntax errors in code o Given a problem you should be able to write an algorithm in pseudocode for the problem o o o o o C End of chapter questions o R1 1 R1 5 R1 7 R1 8 R1 9 R1 11 R1 12 R1 14 o E1 1 E1 4 o P1 1 P1 3 P1 6 II Chapter 2 All Sections A Terms Class Variable Scope reserved words character comment Public interface return values mutator method reference type variable B Object Declaration Variable type integer string assignment method void package Main variable initialization identifiers floating point number literal expression method arguments accessor method primitive type variable Topic o You should be able to declare variables of the primitive types o You should be able to declare and use strings o You should be able to identify a type mismatch to identify when the wrong type is assigned to a variable o You should be able to use the String methods discussed in class in in the lectures on eCampus o You should be know the difference between static and instance methods o You should know how to use class String and it s methods o You should know how to use class Math and it s methods o You should understand print and println o If I have a variable of type String what method from class String would I use to get the length of the String get the character at index 8 find the index of the first blank space find the index of the last blank space find the beginning index of the substring cat extract the portion of the string from index 3 to 9 extract all of the string from index 8 to the end of the string convert the string to all upper case or lower case replace all occurrences of an a with o C End of Chapter Questions o R2 1 R2 11 R2 20 III Chapter 4 All Sections excluding printf A Terms expressions increment decrement Strings B magic number operands Topics o o o o o o o o o o o o C assignment operators operators String input You should be able to write expressions You should be able to Calculate the value of expressions Determine if an assignment is valid based on the value of an expression You should be able to trace through some code and give the output You should know that constants once initialized cannot be assigned a new value final variables Why where would you use constants How do you declare constants You should understand the precedence and Associativity of arithmetic operators You need to understand integer dividion IE 5 2 2 NOT 2 5 You should be able to understand and use basic methods from class Math pow sqrt max min round given an algebraic expression you should be able to write an equivalent COMPILABLE java expression You should understand casting For class Scanner you must know how to You should be able to use class Scanner to receive keyboard input see the supplemental lecture on eCampus Know the difference between calls to next and nextLine Know how to read numeric input from the keyboard with nextInt nextFloat nextDouble etc For class String you should understand all the methods discussed in class and used in lab indexOf substring concat length replace toUpperCase toLowerCase You must be able to correctly call a constructor to create an instance of class String Name accessor and mutator methods from class String End of chapter questions o R4 1 R 4 16 o E4 1 4 13 o P4 2 P4 3 P 4 8 P4 9 IV Methods from my lecture on methods A Terms method activation arguments B method call activation record call by value calling program formal parameters local variables Topics o o o o o o o o o o You should be able to trace the execution of a method What is the return type of a method that doesn t produce a value How many values can be returned by a return statement What does the return statement do You should be able to call static user defined methods You should understand the difference between formal parameters in method specifications and actual parameters in method calls Given a method specification you should be able to evaluate a call to the method and determine if it is syntactically correct Given the specification for a method you should be able to write a correct call to the method Know the 4 benefits of using methods in programs Given a problem description you should be able to write a simple method Cuts the string in 1 2 reverses the halves and returns the new string given the radius of a circle returns the area or circumference of the circle calculates the volume area or perimeter of a shape
View Full Document
Unlocking...