U2: Further Java Fundamentals Flashcards

You may prefer our related Brainscape-certified flashcards:
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
Q

“Prompt the User”

A

Ask the user info; Read it into program

26
Q

Reading in Data From User [A]

A

Use [import java.util.Scanner;] at top of program

27
Q

Reading in Data From User [B]

A

Instantiate scanner [Scanner keyedInput = new Scanner(System.in);]

28
Q

Reading in Data From User [C]

A

Use [keyedInput.nextLine/Double/Int()] for strings, doubles, integers

29
Q

Constants

A
  • Values don’t change as program runs
  • Use when constantly giving same value
30
Q

Constant Attributes

A
  • Declared and initialized on same line
  • Preceded by word “final”
  • Have capital letters
31
Q

When to Use Constants

A
  • Dates from past
  • Tax rates
  • Prices of things
  • Longer names
  • Provinces, Countries, Cities
32
Q

Rounding Techniques

A
  • Multiplication/division by 10^x; x = no. of decimal values removed
  • variable = Math.round (variable) to nearest whole number
33
Q

Benefits of Organized Programs

A
  • Easier to write; remember which subtasks already done
  • Easier to debug; collaborate on
  • Easier to maintain, update or re release
34
Q

When to Comment [A]

A
  • Where variables declared and initialized
  • How user input generated
35
Q

When to Comment [B]

A
  • Calculations, processing, formatting
  • Loops/selection statements
36
Q

Function of {}

A

Shows where parts of program start and end

37
Q

Function of []

A

Index arrays

38
Q

Function of ()

A

Order of operations (B in BEDMAS); provide parameters to method

39
Q

Console

A
  • Allows output to screen
  • Doesn’t allow graphics, dropboxes, text fields
  • Programmers test console first, then develop GUI