Title: CIS 199 Test 01 Review
1CIS 199 Test 01 Review
2Computer Hardware
- Central Processing Unit (CPU)
- Brains
- Operations performed here
- Main Memory (RAM)
- Scratchpad
- Work area for programs, process, temporary data
- Secondary Storage
- Hard drive
- Flash drive
- CD, DVD
3Input, Output Devices
- Input
- Takes data IN
- Keyboard, Mouse, Game Controller, Microphone
- Output
- Pushes, places data OUT
- Display, Speakers, Printers
4Programs and Digital Data
- Programs
- Operating Systems. Microsoft Office, Web browsers
- Instructions read by CPU and processed
- Digital Data
- 1s
- 0s
- forms binary (base 2)
5Built-In Types
6Properties
- Exposed Variables or accessible values of an
object - Can have access controlled via scope modifiers
- When thinking of properties Values and
definitions - get Code to run before returning a value
- set Code to run before updating a value
- Can be used for validation and other processing
actions - value is a keyword in set
7(No Transcript)
8Methods
- Actions, code to be executed
- May return a value, may take value (not required)
- Can be controlled via scope keywords
- Can be static
9Scope
- private Can only be accessed by the class,
object itself - protected Can only be accessed by the class,
object, or any child classes, objects - public Available access for all
10Named Constants
- AVOID MAGIC NUMBERS!
- Allows for reference across similar scope
- Change once, changes everywhere
11Conditional Logic
- if(expression)
- If expression is true
- If not true, skipped
- else if(expression)
- Can be used to chain conditions
- Code runs if expression is true
- else
- Code to execute if expression false
- Statements can be nested
12Relational Operators
- gtGreater than
- ltLess than
- gtGreater than OR equal to
- ltLess than OR equal to
- Equal to
- !NOT equal to
- X gt Y
- X gt Y
- X lt Y
- X lt Y
- X Y
- X ! Y
13Operator Precedence
- (Highest)
- , --, !
- /
- -
- lt gt lt gt
- !
-
-
- / -
- (Lowest)
- Detailed fromhttp//msdn.microsoft.com/en-us/lib
rary/2bxt6kc428vvs.10029.aspx
14Comparing Strings
- You can use
- , !
- You cannot use
- gt, gt, lt, lt
- You SHOULD use
- String.Compare(s1, s2)
- s1 gt s2
- Returns positive Number
- s1 s2
- Returns zero
- s1 lt s2
- Returns negative number
- Compares the unicode value of EACH character
15Exceptions andException Handling
- Exceptions are
- Exceptional events
- Unexpected events, errors during runtime
- Unhandled exceptions? Stack trace and application
death - Handled with try/catch/finally blocks
- Try block attempts to run the code in question
- Catch block handles the exception(s) that may
occur - Finally block, optional, always executes
16(No Transcript)
17(No Transcript)
18Sample Questions fromBlackboard Wiki
19What does WYSIWYG stand for?
- What
- You
- See
- Is
- What
- You
- Get
20GroupBox Vs Panel
- GroupBoxes have
- Group Title
- Panels have
- Scroll bar
- Border styling options
21What is the difference between a high-level and a
low-level language?
- Low-Level
- Little to no abstraction from the hardware or
computer - Close to the hardware
- Simple, but Difficult to use
- Machine code, assembly, C (in some cases)
- High-Level
- Very strong abstraction from the hardware or
computer - Far from the hardware
- Easier to use, abstraction adds complexity
- C, Java, C, Python
22How is the lifetime of a FIELD different from a
lifetime of LOCAL variable?
- Fields are members of their containing type
- Fields can be used everywhere with appropriate
scope - Local variables can be used only in their local
environment
23What two things does a variable declaration
specify about a variable?
TYPE
IDENTIFIER
24Describe and and how they work.
- (AND)
- Returns true if conditions are ALL true
- If you do well on the test AND the quiz, you
will earn a great grade! - (OR)
- Returns true if ANY conditions are true
- You can run a mile OR walk two miles (possible
do both!)
25Why is TryParse more effective than Parse?
- Less code
- No try / catch required
26What is the difference between a SIGNED an
UNSIGNED int?
27What is the difference between syntax errors and
logic errors?
- Syntax Errors Errors that prevent compilation
or other factors that prevent successful
compilation - striing myString string.Empty // Wont
compile, syntax error - Logic Errors Errors that occur during runtime,
such as incorrect comparison or other unexpected
behavior - If(grade gt 60) Code if grade is F //
Incorrect operator used
28What are the Five logical units?
- CPU Processing, instructions
- Memory Scratch pad, working space (Temporary)
- Secondary Storage Hard drives, storage (Long
term) - Input Keyboards, Mice, Controllers
- Output Monitors, Speakers, Printers
29Explicit type conversion? Why and how?
- Variables must be used for a single type never
change - Move from one type to another, must cast
- EXPLICIT cast / type conversion
- Aware of information loss
30Write a code fragment that will display Good
Job when int variable score is 80 or more, OK
when score is 70 79, and Needs Work for any
score under 70.
31Write a code fragment that will apply a 10
discount to the value in double variable total
when int variable numItems is 5 or more and int
variable zone is 1, 3 or 5.
32Class Vs Objects
- A Class can be described as a logical collection
of attributes and behaviors (methods) that
describe how a group of objects look and
behave. - An object is an instance of a class.
- Classes can be viewed as templates from which
objects are created e.g. building plan (class) ?
houses (object) - The objects from a class can share the same
features and structures but can differ in
implementation and use e.g. Car (Class) ? RedCar
(object 1), BlueCar (object 2), SilverFastCar
(object 3), SilverSlowCar (object 4)
class
Car RedCar new Car(Red, 90.0) //object
1 Car BlueCar new Car(Blue, 90.0) //object
2 Car SilverFastCar new Car(Silver, 100.0)
//object 3 Car SilverSlowCar new Car(Silver,
20.0) //object 4
Car Color MaxSpeed Accelerates()
Attributes
method
33Question?
34How can REACH further help you today?
- Ask Questions Now!
- Need to see an Example?
- Need to see a concept again?
- Need additional help?
- Visit us at
- iTech Zone
- CRC (Ekstrom Library)
- Monday-Thursday800am 800pm
- Friday800am 400pm
- Sunday1200pm 200pm (CRC Only)