Chapter 1 PDF Flashcards
What is programming
Creating an application, such as a ticketing kiosk, a game, a restaurant ordering system, or another business application.
What are some basic computer concepts
Hardware
Operating Systems
Application Software
Computer networks and the Internet
What is the purpose of the CPU
Executes the instructions of the program
What is the purpose of the Hard Disk and CD ROM
Store instructions and data so the program can be loaded into memory and executed
What is the purpose of the main memory of the computer
Stores the program instructions and data while executing
What is the main purpose of the Keyboard and mouse
Used for data input
What is the purpose of the monitor
Used to display output from a program
What is the purpose of the arithmetic logic unit inside the CPU
Performs interger arithmetic and logical operations
What is the purpose of the floating point unit inside of the CPU
Performs floating point operations
What is the purpose of harder registers inside of the CPU
Stores data and memory addresses
What is the purpose of an instruction pointer in the CPU
Keeps track of the next instruction to execute
What is the purpose of the CPU Instructions
- Move data from one location to another
- Perform a calculation
- Compare data
- Change the sequence of instructions to execute (the flow of control)
What is the first step in the 5 step Fetch-Decode-Execute Cycle?
The program counter keeps track of the next instruction to be executed
What is the second step Fetch-Decode-Execute Cycle?
The CPU fetches the next instruction from memory and places it into the Instruction Register.
What is the third step Fetch-Decode-Execute Cycle?
The instruction is decoded (is the instruction a move, load, store, etc?)
What is the fourth step Fetch-Decode-Execute Cycle?
The instructions are executed
What is the fifth step Fetch-Decode-Execute Cycle?
This Fetch-Decode-Execute Cycle repeats until the program ends
What is CPU speed rated in
MHz or GHz
What occurs in one clock cycle of a CPU
Fetches an instruction from memory,
decodes the instruction,
executes the instruction
What does pipelining a CPU do
Pipelining allows overlap of operations to improve performance
How many bits is inside of memory cells
One bit
What can a bit’s value be
0 or 2
What does a byte represent
8 bits
What does an OS do when computer is turned on
Boots when the computer is turned on and runs continuously
What does an OS do
Controls the peripheral devices
Supports multitasking
Allocates memory to each program
Prevents one program from damaging another program
What is multitasking
Multiple programs executing simultaneously
What are some examples of peripheral devices
Disks, keyboard, mouse, etc
What is the function of application software
Written to perform specific tasks
Where does the application software run in relation to the operating system
Runs on top of the operating system
What are some examples of application software
word processor, spreadsheet, database management system, games, internet browser
What is the purpose of a network
To connect two or more computers so they can share files or devices
Describe a LAN network
Computers located geographically close to one another
How are LAN networks connected
Wirelessly or through cables
What do servers provide
Access to database
Downloading of files
Email delivery
What is the internet
A network of networks
Where did the internet evolve from
the ARPANET military research project
What do web servers do
Website servers deliver Internet content to clients via a browser
What is used to identify web pages
A URL
What is a URL
Uniform Resource Locator
What is a LAN
A local area network
What is the purpose of DNS servers
Translates a URL to an Internet Protocol (IP) address
What is a DNS
Domain name system
Describe Binary numbers
Expressed in base 2 system (two digits are 0 and 1)
Describe Hexadecimal numbers
Base 16 systems used as shorthand for representing binary numbers
What is the unicode character set used for
Used to represent characters
How can a decimal or base 10 number be represented
As the sum of powers of 10 (the base) with coefficients in the base 10 alphabet (0-9)
Whats step one of three from converting from decimal to binary
Find the largest power of 2 that is smaller than or equal to the decimal number
Whats step two of three from converting from decimal to binary
Insert 1 in the binary number for the position equivalent to that power of 2
Whats step three of three from converting from decimal to binary
Subtract that power of 2 from the decimal number. Repeat steps 1-3 until you reach 0
insert a coefficient of 0 for any missing powers of 2
Describe hexadecimal numbers
Base 16 number system
Uses digits 0-9 and lets A-F
One hexadecimal digit can express decimal values 0-15
How many bits can one hexadecimal digit represent
4 bits
How many bits can one unicode character set
Each character is stored as 16 bits.
The ASCII character set stores each character as how many bits
7 bits
What are the three levels of programming languages
Machine Language
Assembly Language
High-Level Languages
Describe Machine Language
Written using CPU instruction set
Difficult to write and not portable
Describe Assembly Language
– Written using mnemonics for instructions and symbolic names for variables
– Assembler converts code to machine language
– Easier to write, but still not portable
What are some examples of High-Level Languages
Fortran, COBOL, Ruby, Objective, C, C++, PHP, Python and Java
Describe High Level Languages
Highly symbolic
Portable among CPU architectures
Languages can be designed for specific uses
What are Ruby, PHP and Python used for
Internet Applications
What was Fortran used for
Scientific applications
What was COBOL used for
Business applications
What is a compiler used for
A compiler converts source code (instructions) into machine language and then the program is executed
What does an interpreter do
Interpreter converts instructions into machine language at run time as instructions are executed
Describe an interpreter vs a compiler
Usually executes more slowly than compiled program
Describe Java
Combination of compiler and interpreter
What is the function of a compiler
Converts source code into byte codes
What is byte codes
an instruction set for a virtual machine-indendent processor
What does a Java Virtual Machine do at run time
At run time the Java Virtual Machine interprets the byte codes and converts them into the machine language for the platform on which the program is running
What is the class function used for in object-oriented programming
A tool for encapsulating data and operations into one unit
What is another word for operations
methods
What is class used to define
Class is used to define a template or model for creating and manipulating objects
What is an object
Data created using the class and its methods,
What is an object in relation to the class
An object is an instance of the class
What is it called when you create an object
Instantiation
What is the advantage to OBJECT ORIENTED PROGRAMMING
Well-written classes can be reused in new applications
Why would reusing the OOP be advantageous
Shortens development time because programmers don’t need to write that code again
When was the Java language created and by whom
It was created by Sun Microsystems in 1995
What is the java syntax based on
C++
Describe the orientation of the java language
Object oriented
What are some general java features
Supports internet applications
Provides an extensive library of classes
Is portable among platforms
Has built-in networking
What are applets (java program)
Small programs designed to add interactivity to websites
Downloaded with the webpage and launched by an internet browser
What are Servlets (java program)
Run by web server on the server
Typically generate web content
What are applications (java program)
Programs that run standalone on a client
What is programming in general terms
Programming is translating a problem into ordered steps consisting of operations a computer can perform
What are some examples of operations that computers can perform
Input Perform Calculations Compare values Move data Output
What is the name of the order of executions of instructions called
Flow of control
What is pseudocode
English-like language for specifying the design of a program.
What is the benefit to using pseudocode
Programmers can concentrate on design of a program without worrying about Java language rules
What is syntax
Language rules
What happens to pseudocode once it is written
It then needs to be converted into Java code
What is Sequential processing (in relation to four types of flow of control)
It executes instructions in order
What is Method call (in relation to four types of flow of control)
It jumps to code in method and then returns
What is Selection (in relation to four types of flow of control)
Choose code to execute based on data value
What is looping or Iteration (in relation to repeat operations for multiple data values)
Repeat operations for multiple data values
What does calling the method do
Calling the method executes the method
What can methods use
They can take arguments (data to use) and return values
What is an IDE
Integrated Development environment
What is an IDE used for
Typically programmers use an IDE to develop programs
What does an IDE consist of
an IDE consists of a program editor, a compiler, and a run-time environment integrated via a Graphical User Interface
What are some common errors in java
- *Java is case sensitive
- *The Source file must be saved with the same name as the class name with the .java extension
- *The class name and the source file name must match exactly, including capitalization
What are the three types of Program Errors
Compiler Errors
Run-time Errors
Logic Errors
What finds compiler errors
The compiler
What are compiler errors usually caused by
Usually caused by incorrect syntax or spelling
What finds Run-time errors
Reported by the JVM
What are Run-time errors usually caused by
Usually caused by incorrect use of prewritten classes or invalid data
What finds logic errors
Found by testing the program
What are logic errors usually caused by
Incorrect program design or incorrect execution of the design
What are JAR files
Java programs are typically distributed as JARs
What does JAR stand for
JAR Archive
What is a .jar extension usually associated with
The JVM
What happens if a user double clicks on the JAR file
The program starts executing