Download Chapter1 Review

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Chapter 1
Introduction to Computers and
Java
Topics
1. Introduction
2. Why Program?
3. Computers Systems: Hardware and
Software
4. Programming Languages
5. What Is a Program Made of?
6. The Programming Process
7. Object-Oriented Programming
1. Introduction
• Java is a powerful language that runs on
practically every type of computer
• Java can be used to create large
applications or small programs, known as
applets, that are part of a Web site
2. Why Program?
• The computer can do such a wide variety
of tasks because it can be programmed
• Computers do whatever job their
programs, or software, tell them to do
• Programmers create software using
programming languages such as Java
because computers do not understand
human languages
3. Computer Systems
• All computer systems consist of similar
hardware devices and software
components
• Hardware refers to physical components
that a computer is made of
• Software refers to programs that run on a
computer. There are 2 general categories
of software: operating systems and
application software
Checkpoint
1.
2.
3.
4.
5.
6.
7.
Why is the computer used by so many different people,
in so many different professions?
List the 5 major hardware components of a computer
systems?
The CPU consists of what 2 units
Describe the steps in the fetch/decode/execute cycle
What is a memory address? What is its purpose?
Why computers have both main memory and
secondary storage
What does the term “multitasking” mean?
4. Programming Languages
• A program is a set of instructions a
computer follows in order to perform a task
• These instructions are called an algorithm
• A computer can only process instructions
that are written in machine language look
like: …1011010000000101…
• Programming languages, which use words
instead of numbers, and then translated
into machine language by software
4. Programming Language: Java
•
•
•
•
•
•
Created in 1991
Sun Microsystems
Original name: Oak
Byte code
Java Applications
Java applets
5. What is a program made of?
• Common elements of a programming
language:
– Key words (reserved words)
– Operators, operands
– Punctuation
– Programmer-defined Names (Identifiers)
– Syntax
5. What is a program made of?
•
•
•
•
•
•
Lines: blank line, comments, statements
Variables
Source code, source file, .java extension
Compiler
Java Virtual Machine (JVM)
Java Software Editions (JDK, SDK)
– Java SE
– Java EE
– Java ME
Checkpoint
8.
9.
10.
11.
12.
13.
14.
15.
16.
Describe the difference between a keyword and a
programmer-defined symbol.
Describe the difference between operators and
punctuation symbols.
Describe the difference between a program line and a
statement.
What is a variable?
What happens to a variable’s contents when a new
value is stored there?
What is a compiler?
What is a syntax error?
What is byte code?
What is the JVM?
6. The programming process
1.
2.
3.
4.
5.
6.
7.
8.
9.
Clearly define what the program is to do (4 items)
Visualize the program running on the computer
Use design tools to create a model of the program
Check the model for logical errors
Write the code and compile
Correct compile errors during compilation
Run the program
Correct runtime errors
Validate the results
Checkpoint
17. What 4 items should you identify when defining what a
program is to do?
18. What does it mean to “visualize a program running”?
19. What is pseudocode?
20. Describe what a compiler does with a program’s
source code?
21. What is a runtime error?
22. Is a syntax error found by the compiler or when the
program is running?
23. What is the purpose of testing a program with sample
data or input?
Find correct answer
1. The part of computer that fetches
instructions, carries out the operations
commanded by the instructions, and
produces outcome.
2. A byte is made of eight _______.
3. Each byte is assigned a unique _______.
4. A type of memory that can hold data for
long periods of time.
Find correct answer
5. The type of program that can run in a Web
browser.
6. The words that have a special meaning in the
programming language.
7. Symbols or words that perform operations on
one or more operands.
8. Characters that serve specific purpose, such
as marking the beginning or the end of a
statement, or separating items in a list.
Find correct answer
9. The rules that must be followed when
writing a program.
10. A named storage location in the
computer’s memory.
11. The Java compiler generates _____.
12. JVM stands for ________.