Chapter 1: Introduction to Computers, Programs, and Java — Flashcards

0.0(0)
studied byStudied by 0 people
0.0(0)
linked notesView linked note
full-widthCall with Kai
GameKnowt Play
New
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/33

flashcard set

Earn XP

Description and Tags

Flashcards covering key concepts from Chapter 1: computers, programs, programming languages, Java basics, program structure, syntax, errors, and programming style.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

34 Terms

1
New cards

What are the main components of a computer as listed in the notes?

CPU, memory, storage (hard disk/floppy disk), input devices (keyboard, mouse), output devices (monitor, printer), communication devices (modem, NIC), and a system bus.

2
New cards

What is a computer program?

A set of instructions that tells a computer what to do; computers do not understand human languages; programs are written in programming languages.

3
New cards

What are the three broad categories of programming languages discussed?

Machine language, assembly language, and high-level language.

4
New cards

Machine language characteristics

Binary instructions built into the computer; written in binary code; tedious to program and hard to read or modify.

5
New cards

Role of an assembler

Converts assembly language programs into machine code.

6
New cards

Purpose of assembly language

Developed to make programming easier; requires an assembler to translate to machine code.

7
New cards

High-level language characteristics

English-like and easy to learn and program.

8
New cards

Why is Java used for Internet applications?

Java enables development and deployment on the Internet across servers, desktops, and handheld devices; it is described as the Internet programming language.

9
New cards

Java's scope according to notes

General-purpose programming language and Internet programming language.

10
New cards

Java application types listed

Standalone applications, applications running from a browser, applications for handheld devices, and web server applications.

11
New cards

List of Java characteristics

Simple; Object-Oriented; Distributed; Interpreted; Robust; Secure; Architecture-Neutral; Portable; Java’s performance; Multithreaded; Dynamic.

12
New cards

What does the sample program print?

Welcome to Java!

13
New cards

What is source code?

A program written in a high-level language that must be translated into machine code before execution, via a compiler or an interpreter.

14
New cards

What is bytecode and the JVM's role?

Java source is compiled into bytecode, which runs on any platform with a Java Virtual Machine that interprets the bytecode.

15
New cards

Java portability benefit

Write the program once and run it on any machine that has a JVM.

16
New cards

Anatomy of a Java program

Class name; main method; statements; statement terminator; reserved words; comments; blocks.

17
New cards

Class name convention

Class names start with an uppercase letter; example: Welcome.

18
New cards

Main method requirement

A class must contain a main method to run; the signature is public static void main(String[] args).

19
New cards

Statement

An action or sequence of actions in a program; e.g., printing a greeting.

20
New cards

Statement terminator

Semicolon ends a statement.

21
New cards

Keywords

Reserved words with special meaning to the compiler; cannot be used as identifiers.

22
New cards

Blocks

Braces { } form a block that groups components; includes class blocks and method blocks.

23
New cards

Special symbols list

Braces { }, parentheses ( ), brackets [ ], // for comments, quotation marks, and semicolon ;

24
New cards

Block Styles

Two brace styles: end-of-line style (brace on same line) and next-line style (brace on the next line).

25
New cards

Programming style and documentation

Involves appropriate comments, meaningful naming conventions, proper indentation/spacing, and block styles.

26
New cards

Appropriate comments content

Begin with a summary explaining the program’s purpose, features, data structures, and techniques; include name, class section, instructor, date, and description.

27
New cards

Naming conventions for classes

Choose meaningful names; class names capitalize the first letter of each word (e.g., ComputeExpression).

28
New cards

Indentation and spacing guideline

Indent by two spaces; use blank lines to separate segments of code.

29
New cards

Programming errors categories

Syntax errors (detected by the compiler); runtime errors (program aborts); logic errors (incorrect results).

30
New cards

Syntax error example

Illustrative example shows malformed main declaration and an unterminated string, highlighting a syntax error.

31
New cards

Runtime error example

Division by zero (1 / 0) illustrating a runtime error.

32
New cards

Logic error example

Incorrect Celsius-to-Fahrenheit calculation due to the wrong formula or integer division.

33
New cards

Quotation marks in strings

Strings are enclosed in double quotation marks.

34
New cards

Comment syntax

Single-line comments start with //.