U2: Further Java Fundamentals Flashcards

(39 cards)

1
Q

Input Processing Output Model

A
  • Entered from digital input or input device into program
  • Info processed (calculations, altered, etc)
  • Output to user or output device
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Process

A
  • Involves manipulation, transformation of inputs
  • Executing instructions, making decisions
  • Assessing/modifying data structures
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Application of IPO Model

A
  • Applicable across different domains of computer science
  • Software development, data processing, networking
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
  1. Understand the Problem
A

Define problem statement; Identify inputs and outputs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
  1. Design the Solution
A
  • Determine steps needed to obtain input data
  • Define processing required to produce desired output
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
  1. Implement the Solution
A
  • Write code to obtain input data from user
  • Implement algorithms to process input data
  • Add comments
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
  1. Documentation
A
  • Add comments to explain purpose, functionality
  • Re-read comments and add additional ones
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
  1. Testing
A

Test program with different input values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Variable

A
  • Named location in computer’s memory
  • “Named” as it’s referenced by using name
  • Can be initialized by math equations
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Functions of Variables

A
  • Declaring a variable = making it exist
  • Initializing a variable = giving it’s first value
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Variable: int (Integer)

A
  • Positive/negative #’s w/out decimals
  • Between -2,147,438,648 and 2,147,438,647
  • Takes 32 bits memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Variable: double (Double)

A
  • Positive/negative #’s w/ decimals
  • Up to 15 decimal places accurately
  • Takes 64 bits memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Variable: char (Character)

A
  • Single character; 16 bits memory
  • Defined using single quotation marks
  • Ex: ‘A’, ‘v’, ‘&’, ‘?’
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Variable: boolean (Boolean)

A

True/false; 1 bit memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

“Not” Variable: String (String)

A
  • Series of characters, words, sentences
  • Memory varies by size string
  • Defined using double quotation marks
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Input as String: Errors

A
  • If invalid input, program can handle errors
  • Allows program to validate input before conversion
17
Q

Input as String: Special Cases

A
  • Allows program to handle special cases
  • Ex: measurement units, prompts on context of input
18
Q

Input as String: Flexibility

A
  • More flexibility over complex inputs
  • Ex: multiple values, non-numeric characters
19
Q

Input as String: Parsing

A

Numeric string data must be parsed (i.e. converted) to numeric data type

20
Q

“”

A

Separates two variables with numbers by decimal with the +

21
Q

Operations in Java

A
  • +: Addition
  • -: Subtraction
  • *: Multiplication
  • /: Division
  • %: Modulus (Remainer of division)
22
Q

Reserved Word

A

Word having function in Java; Ex: “int”

23
Q

Variable Name Requirements

A
  • Describe what variable holds
  • Must not be reserved word
  • Must not be too long (ex: someInformationAboutTheUser)
24
Q

“Instantiating an object”

A

Making the object exist

25
“Prompt the User”
Ask the user info; Read it into program
26
Reading in Data From User [A]
Use [import java.util.Scanner;] at top of program
27
Reading in Data From User [B]
Instantiate scanner [Scanner keyedInput = new Scanner(System.in);]
28
Reading in Data From User [C]
Use [keyedInput.nextLine/Double/Int()] for strings, doubles, integers
29
Constants
- Values don’t change as program runs - Use when constantly giving same value
30
Constant Attributes
- Declared and initialized on same line - Preceded by word “final” - Have capital letters
31
When to Use Constants
- Dates from past - Tax rates - Prices of things - Longer names - Provinces, Countries, Cities
32
Rounding Techniques
- Multiplication/division by 10^x; x = no. of decimal values removed - variable = Math.round (variable) to nearest whole number
33
Benefits of Organized Programs
- Easier to write; remember which subtasks already done - Easier to debug; collaborate on - Easier to maintain, update or re release
34
When to Comment [A]
- Where variables declared and initialized - How user input generated
35
When to Comment [B]
- Calculations, processing, formatting - Loops/selection statements
36
Function of {}
Shows where parts of program start and end
37
Function of []
Index arrays
38
Function of ()
Order of operations (B in BEDMAS); provide parameters to method
39
Console
- Allows output to screen - Doesn't allow graphics, dropboxes, text fields - Programmers test console first, then develop GUI