CSCI 111 Ch. 1-2 Quiz Flashcards
a number system consists of (2 things)
- set of valid characters
2. place values
the base-10 number system is also known as
decimal
what are the valid characters in the base-10/decimal number system?
0-9
in the base-10/decimal number system, place values increase by orders of
10 (10^0, 10^1, 10^2 and so on in the left direction)
Why do we use base 2 (binary) instead of base 10 (decimal)? What does this mean?
Electrostatic Discharge (if electronics are exposed to ESD, voltage can spike -> in base 10, 1v to 8v is a jump of 8000)
the base-2 number system is also known as
binary
what are the valid characters in the binary number system?
0 and 1
in the base-2/binary number system, place values increase by orders of
2 (2^0, 2^1, 2^2 and so on in the left direction)
what is 1 byte equal to (in terms of bits)?
8 bits
what is 1 word equal to (in terms of bytes)?
2 bytes
what are the steps for converting from decimal to binary?
- identify the largest place value that is less than or equal to your number
- set the bit to 1 for that place value
- subtract the place value from your number
- repeat steps 1-3 until the number is zero
- set the remaining bits to zero
the base-16 number system is also known as
hexadecimal
what are the valid characters in the hexadecimal number system?
0-9, A-F
in the base-16/hexadecimal number system, place values increase by orders of
16 (16^0, 16^1, 16^2 and so on in the left direction)
in converting hexadecimal to binary, we have to look at it in terms of ? bits because 16 = 2^4
4
what are the place values for the binary > hexadecimal conversion chart?
8 4 2 1
Java is an ? and ? language that uses an ? / text editor such as Notepad ++
object oriented (OO), compiled, Integrated Development Environment (IDE)
what is the basic skeleton of a java code?
class name & main method
to invoke the java compiler, ? which creates MyProgram.class
javac MyProgram.java
to execute the program, ?
java MyProgram
what are computer programs (aka software)?
instructions to the computer/how we tell the computer what to do
programs are written using ?
programming languages (e.g. Java)
? is a set of primitive instructions built into every computer. it is in the form of ?
machine language; binary code
? were developed to make programming easy
assembly languages
a program called an ? is used to convert assembly language programs into machine code
assembler
? are English-like and easy to learn and program (e.g. Java, Python)
high-level languages
a program written in a high-level language is called a ?, which must be translated into ? for execution
source code; machine code
the translation from source to machine code can be done using an ? or a ?
interpreter, compiler
an interpreter reads ? from the source code, translates it to the machine code, and then executes it right away
one statement
a compiler translates ? into a machine-code file, and the machine-code file is then executed
the entire source code
? is a powerful and versatile programming language that enables users to develop and deploy applications on the Internet for servers, desktop computers, and mobile devices
Java
the ? converts the source code to bytecode (JVM - Java Virtual Machine) and then the Java ? converts and executes the byte code line by line
compiler; interpreter
every Java program must have at least one ?, which has a name that conventionally starts with an ? letter
class; uppercase
capitalize the first letter of each word in the ? name
class