Chapter 2 Flashcards
Algorithm
lists the steps you can follow to solve a problem. They can help the programmer plan a program before writing it in a programming language.
Pseudocode
natural language mixed with some programming code
Main method
where program execution begins
Variable
A variable represents a value stored in the computer’s memory
Data types
the kind of data stored in a variable
Declaring variables
Defines a variable with a data type.
Primitive data types
or fundamental types. simple data types for representing integers, real numbers, characters, and Boolean types. (Byte, short,int, long,float,double,boolean,char).
Floating-point
How Real numbers (i.e., numbers with a decimal point) are represented.
Floating-point numbers
Real numbers.
you can use the keyword double to declare a floating-point variable.
Every Variable has..
Every variable has a name, a type, and a value
Tracing a program
reviewing how a program works. They are are helpful for understanding how programs work, and they are useful tools for finding errors in programs.
The value of a variable is..
not defined until you assign a value.
The plus sign (+) has two meanings:
for addition, and for concatenating (combining) strings
System.out to refers to
the standard output device
System.in refers to
the standard input device.
An output device is
is the display monitor
An input device is
is the keyboard.
To perform console output, you simply use
the println method to display a primitive value or a string to the console.
To perform console input, you need to use the
Scanner class to create an object to read input from System.in
Prompt
directs the user to enter an input
There are 2 types of import statements
specific import and wildcard import.
Specific import
specifies a single class in the import statement.
Wildcard import
imports all the classes in a package by using the asterisk as the wildcard
There is no performance difference between a specific import and a wildcard import declaration.
True.