Podcast
Questions and Answers
What is a byte made up of?
What is a byte made up of?
What is commonly referred to as a word in computing?
What is commonly referred to as a word in computing?
Which of the following devices is considered a secondary storage device?
Which of the following devices is considered a secondary storage device?
Which of the following is NOT an input device?
Which of the following is NOT an input device?
Signup and view all the answers
What is the main purpose of an operating system?
What is the main purpose of an operating system?
Signup and view all the answers
Which of the following is an example of a multitasking operating system?
Which of the following is an example of a multitasking operating system?
Signup and view all the answers
What technique do multitasking operating systems use to manage multiple programs?
What technique do multitasking operating systems use to manage multiple programs?
Signup and view all the answers
Which classification of software includes programs like Microsoft Word and Excel?
Which classification of software includes programs like Microsoft Word and Excel?
Signup and view all the answers
What is the purpose of application software?
What is the purpose of application software?
Signup and view all the answers
Which of the following is not considered application software?
Which of the following is not considered application software?
Signup and view all the answers
What role do algorithms play in computer programming?
What role do algorithms play in computer programming?
Signup and view all the answers
Which statement accurately describes machine language?
Which statement accurately describes machine language?
Signup and view all the answers
What was the first high-level programming language developed?
What was the first high-level programming language developed?
Signup and view all the answers
How does a high-level programming language differ from machine language?
How does a high-level programming language differ from machine language?
Signup and view all the answers
Which of the following types of software would be classified as application software?
Which of the following types of software would be classified as application software?
Signup and view all the answers
What is a defining characteristic of machine language instructions?
What is a defining characteristic of machine language instructions?
Signup and view all the answers
Which statement correctly identifies a common element found in most programming languages?
Which statement correctly identifies a common element found in most programming languages?
Signup and view all the answers
What is the purpose of a key word in programming languages like Java?
What is the purpose of a key word in programming languages like Java?
Signup and view all the answers
In Java, how are statements typically terminated?
In Java, how are statements typically terminated?
Signup and view all the answers
Which of the following is NOT a characteristic of Java key words?
Which of the following is NOT a characteristic of Java key words?
Signup and view all the answers
What differentiates a line from a statement in Java source code?
What differentiates a line from a statement in Java source code?
Signup and view all the answers
What role do variable names play in Java programming?
What role do variable names play in Java programming?
Signup and view all the answers
Which programming language element is emphasized as case sensitive?
Which programming language element is emphasized as case sensitive?
Signup and view all the answers
Which of the following best describes a Java statement?
Which of the following best describes a Java statement?
Signup and view all the answers
What is the purpose of a variable in programming?
What is the purpose of a variable in programming?
Signup and view all the answers
What does the compiler do with a source code file?
What does the compiler do with a source code file?
Signup and view all the answers
What file extension do Java source code files have?
What file extension do Java source code files have?
Signup and view all the answers
Which of the following describes syntax errors?
Which of the following describes syntax errors?
Signup and view all the answers
In the provided example, what does the variable 'length' represent?
In the provided example, what does the variable 'length' represent?
Signup and view all the answers
Where does the Java Virtual Machine (JVM) decide to place the value of a variable?
Where does the Java Virtual Machine (JVM) decide to place the value of a variable?
Signup and view all the answers
What happens to the source code after compilation?
What happens to the source code after compilation?
Signup and view all the answers
Which statement is true regarding the role of the compiler?
Which statement is true regarding the role of the compiler?
Signup and view all the answers
What does the command 'javac filename.java' do?
What does the command 'javac filename.java' do?
Signup and view all the answers
Which of the following is not a step in the programming process?
Which of the following is not a step in the programming process?
Signup and view all the answers
What is the purpose of the Java Development Kit (JDK)?
What is the purpose of the Java Development Kit (JDK)?
Signup and view all the answers
Which Java edition is aimed at enterprise-level applications?
Which Java edition is aimed at enterprise-level applications?
Signup and view all the answers
What should you do after entering the code and compiling it?
What should you do after entering the code and compiling it?
Signup and view all the answers
In which phase do software engineers check for logical errors in their models?
In which phase do software engineers check for logical errors in their models?
Signup and view all the answers
Which task is not typically included in the responsibilities of software engineers?
Which task is not typically included in the responsibilities of software engineers?
Signup and view all the answers
What type of file does the Java compiler produce as output?
What type of file does the Java compiler produce as output?
Signup and view all the answers
What is the primary focus of object-oriented programming?
What is the primary focus of object-oriented programming?
Signup and view all the answers
What is meant by 'data hiding' in object-oriented programming?
What is meant by 'data hiding' in object-oriented programming?
Signup and view all the answers
Which of the following is NOT a task performed by software engineers?
Which of the following is NOT a task performed by software engineers?
Signup and view all the answers
What is an essential characteristic of an object in object-oriented programming?
What is an essential characteristic of an object in object-oriented programming?
Signup and view all the answers
What role do methods play in an object?
What role do methods play in an object?
Signup and view all the answers
In the context of program development, what is a common approach used by software engineers for large applications?
In the context of program development, what is a common approach used by software engineers for large applications?
Signup and view all the answers
Which of the following best describes a programming interface in object-oriented programming?
Which of the following best describes a programming interface in object-oriented programming?
Signup and view all the answers
What is the purpose of using diagrams in software engineering?
What is the purpose of using diagrams in software engineering?
Signup and view all the answers
Study Notes
Book Title and Edition
- Starting Out with Java™ 7th Edition
Chapter
- Chapter 1: Introduction to Computers and Java
Chapter Topics
- Introduction
- Why Program?
- Computer Systems: Hardware and Software
- Programming Languages
- What is a program made of?
- The Programming Process
- Object-Oriented Programming
Java History
- 1991 - Green Team started by Sun Microsystems (now owned by Oracle)
- 7 handheld controllers for multiple entertainment systems
- Need for a programming language that runs on various devices
- Java (first named Oak) developed for this purpose
Introduction
- Java enabled web browser (HotJava) demonstrated at 1995 Sun World conference
- Java incorporated into Netscape shortly after
- Java is cross-platform; meaning it can run on various computer operating systems
Java Applications and Applets
- Java programs can be of two types:
- Applications
- Stand-alone programs that run without the aid of a web browser
- Relaxed security model since the user runs the program locally
- Applets
- Small applications that require the use of a Java enabled web browser to run
- Enhanced security model since the user merely goes to a web page and the applet runs itself
- Applications
Why Program? (1 of 3)
- Computers are tools that can be programmed to perform many functions, such as:
- Spreadsheets
- Databases
- Games
- Word processing
- Computers versatile because they can be programmed
- Computer programmers implement programs that perform these functions
Why Program? (2 of 3)
- Aspects of a computer program that must be designed:
- Logical flow of instructions
- Mathematical procedures
- Layout of programming statements
- Appearance of the screens
- Way information is presented to the user
- Program's "user friendliness"
- Manuals, help systems, and documentation
Why Program? (3 of 3)
- Programs must be analytically correct.
- Programs rarely work the first time.
- Programmers must analyze, experiment, correct, and redesign programs continuously.
- Programming languages have strict rules (syntax) that must be followed carefully.
Computer Systems: Hardware (1 of 2)
- Computer hardware components are the physical pieces of the computer
- Major hardware components of a computer:
- Central processing unit (CPU)
- Main memory
- Secondary storage devices
- Input and output devices
Computer Systems: Hardware (2 of 2)
- Diagram illustrating the relationships between computer hardware components (Input, CPU, Memory, Storage, Output)
Computer Systems: Hardware
- Main Memory (1 of 3)
- Commonly known as Random Access Memory (RAM)
- RAM contains currently running programs, and data used by those programs
- RAM is divided into units called bytes
- A byte consists of eight bits that may be either on or off
Computer Systems: Hardware
- Main Memory (2 of 3)
- A bit is either on or off
- 1 = on , 0 = off
- Bits form a pattern representing a character or number
- Each byte in memory is assigned a unique number (address)
- RAM is volatile; when the computer is turned off, the contents of RAM are erased
- A bit is either on or off
Computer Systems: Hardware
- Main Memory (3 of 3)
- Main memory can be visualized as a column or row of cells
- A section of memory is called a byte
- A byte is made up of 8 bits
- A section of two or four bytes is often called a word
Computer Systems: Hardware
- Secondary Storage Devices
- Secondary storage devices are capable of storing information for longer periods (non-volatile)
- Common storage devices:
- Disk drive
- External drive
- CD drive
- Solid state drive
- USB drive
- DVD drive
Computer Systems: Hardware
- Input Devices
- Input is any data the computer collects from the outside world
- Data comes from input devices
- Common input devices:
- Keyboard
- Mouse
- Scanner
- Digital camera
Computer Systems: Hardware
- Output Devices
- Output is any data the computer sends to the outside world
- Data displayed on output devices
- Common output devices:
- Monitors
- Printers
- Some devices such as disk drives perform input and output, and are called I/O devices (input/output)
Computer Systems: Software
- Software refers to programs that run on a computer
- Two classifications of software:
- Operating Systems
- Application Software
Computer Systems: Software
- Operating Systems (1 of 2)
- An operating system is a set of programs that manages the computer's hardware devices and controls their processes.
- Most modern operating systems are multitasking
Computer Systems: Software
- Operating Systems (2 of 2)
- A multitasking operating system can run multiple programs at once
- Techniques are called timesharing
- A multitasking system divides the allocation of hardware resources and the attention of the CPU among all executing programs
- Unix
- Linux
- MacOS
- Windows
Computer Systems: Software
- Application Software
- Application software makes the computer useful to the user
- Application software provides a specialized environment for the user to work in
- Common application software:
- Spreadsheets
- Word processors
- Accounting software
- Tax software
- Games
Programming Languages (1 of 5)
- A program is a set of instructions a computer follows to perform a task.
- A programming language is a special language used to write computer programs.
- A computer program is a set of instructions that enable the computer to solve a problem or perform a task
- Collectively, these instructions form an algorithm
Programming Languages (2 of 5)
- An algorithm is a set of well-defined steps to completing a task.
- Steps in an algorithm are performed sequentially.
- A computer needs the algorithm to be written in machine language.
- Machine language is written using binary numbers.
- The binary numbering system (base 2) only has two digits (0 and 1).
Programming Languages (3 of 5)
- Binary numbers are encoded as machine language
- Each CPU has its own machine language
- Motorola 68000 series processors
- Intel x86 series processors
- ARM processors, etc.
- Example of a machine language instruction: 1011010000000101
Programming Languages (4 of 5)
- In the past, programmers wrote programs in machine language.
- Programmers developed higher-level programming languages to make things easier
- The first of these languages was assembler.
- Assembler made things easier, but was also processor-dependent
Programming Languages (5 of 5)
- High-level programming languages followed, that were not processor dependent
- Some common programming languages:
- Java
- BASIC
- COBOL
- Pascal
- C
- C++
- C#
- PHP
- Visual Basic
- Python
- Ruby
- JavaScript
Programming Languages
- Common Language Elements
- Some concepts common to virtually all programming languages:
- Keywords
- Operators
- Punctuation
- Programmer-defined identifiers
- Strict syntactic rules
Programming Languages
- Sample Program (1 of 2)
- Sample Java code (public class HelloWorld)
Programming Languages
- Sample Program (2 of 2)
- Key words in sample program: public, class, static, void
- Key words are lower case (Java is case sensitive)
- Key words cannot be used as programmer-defined identifiers
- Semi-colons end Java statements, however not all lines end a statement.
Programming Languages
- Lines vs Statements
- Differences between lines and statements when discussing source code
- Example: System.out.println(message); ; one Java statement spread across two lines.
- A statement is a complete instruction that causes the computer to perform an action.
Programming Languages
- Variables (1 of 3)
- Data in a Java program is stored in memory
- Variable names represent a location in memory
- Variables in Java are sometimes called fields
- Variables are created by the programmer using a programmer-defined identifier
- Example: int hours = 40;
Programming Languages
- Variables (2 of 3)
- Variables are simply a name given to represent a place in memory
Programming Languages
- Variables (3 of 3)
- JVM (Java Virtual Machine) decides where the value will be placed in memory.
The Compiler and the Java Virtual Machine (1 of 4)
- Programmer writes Java programming statements for a program, known as source code.
- A text editor is used to create and save the Java source code file.
- Source code files have a
.java
extension. - A compiler is a program that translates source code into an executable form.
The Compiler and the Java Virtual Machine (2 of 4)
- A compiler is run using a source code file as input.
- Syntax errors in the program are found during compilation.
- Syntax errors are mistakes that violate the programming language rules.
- The compiler creates another file containing translated instructions.
The Compiler and the Java Virtual Machine (3 of 4)
- Most compilers translate source code into executable files with machine code.
- The Java compiler translates a Java source file into bytecode instructions.
- Bytecode instructions are the machine language of the Java Virtual Machine (JVM).
The Compiler and the Java Virtual Machine (4 of 4)
- Bytecode files have a
.class
extension. - The JVM is a program that emulates a microprocessor.
- The JVM executes instructions as they are read.
- JVM is often called an interpreter.
- Java is often referred to as an interpreted language.
Program Development Process
- Diagram showing the process of Java program development (text editor -> Save Java Statements -> Java compiler -> produces byte code -> JVM executes)
Portability (1 of 3)
- Portable means a program written on one type of computer can run on many computers with little modification.
- Java bytecode runs on the JVM, not the CPU. Java programs are highly portable.
- JVMs exist on many platforms
- Windows
- Unix
- BSD
- MacOS
- Linux
- etc.
Portability (2 of 3)
- With most programming languages, portability is achieved by compiling a program for each CPU it will run on.
- Java provides a JVM (Java Virtual Machine) for each platform, so programmers don't need to recompile for different platforms.
Portability (3 of 3)
- Diagram showing bytecode (.class) running on multiple Java Virtual Machines for various platforms
Java Versions
- Java Development Kit (JDK) is used to write Java programs.
- Different editions of JDK:
- Java SE (Standard Edition)
- Java EE (Enterprise Edition)
- Java ME (Micro Edition)
- Available for download at http://java.oracle.com
Compiling a Java Program
- The Java compiler is a command-line utility.
- The command to compile a program is
javac filename.java
. -
javac
is the Java compiler. - The
.java
file extension must be used.
The Programming Process (1 of 2)
- Steps of the programming process
-
- Clearly define what the program is to do
-
- Visualize the program running on the computer
-
- Use design tools to create a model of the program.
-
- Check the model for logical errors
-
The Programming Process (2 of 2)
- Steps of the programming process
-
- Enter the code and compile it
-
- Correct any errors found during compilation
-
- Run the program with test data for input
-
- Correct any runtime errors found while running the program
-
- Validate the results of the program
-
Software Engineering (1 of 3)
- Encompasses the whole process of crafting computer software
- Software engineers perform several tasks in developing complex software projects:
- Designing
- Writing
- Testing
- Debugging
- Documenting
- Modifying
- Maintaining
Software Engineering (2 of 3)
- Software engineers develop:
- Program specifications
- Diagrams of screen output
- Diagrams representing program components and the flow of data
- Pseudocode
- Examples of expected input and desired output
Software Engineering (3 of 3)
- Software engineers use special software designed for testing programs.
- Most commercial software applications are large and complex.
- Usually a team of programmers, not a single individual, develops them.
- Program requirements are thoroughly analyzed and divided into subtasks handled by individuals within a team.
Object-Oriented Programming (1 of 4)
- Object-oriented programming is centered on creating objects rather than procedures.
- Objects are a combination of data and procedures (methods) that manipulate that data.
- Data in an object are called attributes
- Procedures in an object are called methods.
Object-Oriented Programming (2 of 4)
- Diagram showing an object with attributes (data) and methods (procedures/behaviors)
Object-Oriented Programming (3 of 4)
- Object-oriented programming combines data and behavior via encapsulation
- Data hiding is the ability of an object to hide data from other objects in the program.
- Only methods of an object should be able to directly manipulate its attributes
- Other objects can manipulate attributes via an object's methods.
- This indirect access is a programming interface
Object-Oriented Programming (4 of 4)
- Diagram showing an object with attributes (data) and methods (procedures/behaviors) and a programming interface enabling other objects to interact indirectly.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Test your knowledge on fundamental computer concepts, including data storage, operating systems, and software types. This quiz covers essential questions about bytes, input and output devices, and programming languages. Perfect for beginners and students in computer science.