Chapter 1: Introduction to Computers, Programs, and Java - Vocabulary Flashcards
Introduction to Computers, Programming, and Hardware
The fundamental goal of computer programming is to solve problems by creating software.
Programming (also termed software development) is the process of creating software.
Software (or a program) consists of instructions that tell a computer or a computerized device what actions to perform.
Software is ubiquitous in modern society, powering personal computers as well as embedded systems in devices such as airplanes, automobiles, cell phones, and household appliances like toasters.
Common personal computer software applications include:
Word processors (used to create and format written documents).
Web browsers (used to navigate and explore the Internet).
E-mail clients (used to send and receive electronic messages).
Programming Languages: Software developers create software using tools known as programming languages. There is no single "best" programming language; each language has distinct strengths, weaknesses, and intended use cases. Experienced software developers master multiple languages to expand their arsenal of development tools.
Learning a first programming language establishes core problem-solving methodology, making it straightforward to learn subsequent programming languages.
Computer Systems and Hardware Architecture
A computer is an electronic device that stores and processes data.
A computer system is comprised of two primary components:
Hardware: The physical, tangible, visible components of a computer.
Software: The intangible, invisible set of instructions that direct the hardware to perform tasks.
Computer components are interconnected via a subsystem called a bus.
A bus functions as a network of internal roads carrying data and power between system components.
In personal computers, the bus is integrated into the computer's motherboard, which is a circuit board connecting all internal components.

Major Hardware Components
Central Processing Unit (CPU)
The Central Processing Unit (CPU) is the operational brain of the computer. It retrieves instructions from memory and executes them.
The CPU typically consists of two main internal components:
Control Unit: Controls and coordinates the actions and timing of all other computer components.
Arithmetic/Logic Unit (ALU): Performs mathematical operations (addition, subtraction, multiplication, division) and logical comparisons.
CPUs are fabricated on small silicon semiconductor chips containing millions of tiny electronic switches called transistors.
Clock Speed:
Every computer contains an internal clock that emits electronic pulses at a constant rate to synchronize operations.
Higher clock speeds allow a processor to execute more instructions in a given unit of time.
Measured in Hertz (Hz), where .
In the 1990s, CPU speeds were measured in Megahertz (MHz) ().
Modern CPU speeds are measured in Gigahertz (GHz) (). Modern Intel processors run at speeds around .
Cores:
A core is the portion of the processor that reads and executes instructions.
Early CPUs contained only a single core. Contemporary CPUs are multicore processors, combining two or more independent cores on a single component (e.g., dual-core, tri-core, quad-core) to enhance performance.
Bits, Bytes, and Data Representation
Computers store data using electronic switches that exist in two stable states: on () or off ().
Bit: Short for binary digit. The basic unit of data in computing, taking a value of either or in the binary number system.
Byte: The minimum storage unit in a computer system, consisting of .
Encoding Schemes: Rules that define how characters, numbers, and symbols are converted into unique binary bit patterns.
Example: In the ASCII encoding scheme, the uppercase character
'C'is represented by the 8-bit byte01000011.The number is represented as
00000011.
Units of Storage Capacity:
Kilobyte (KB): Approximately ( or ).
Megabyte (MB): Approximately ( or ).
Gigabyte (GB): Approximately ().
Terabyte (TB): Approximately ().
Concrete Capacity Examples:
A typical 1-page word processing document occupies about .
can store approximately of text documents.
can store approximately of text documents.
A 2-hour high-resolution movie occupies about ; storing requires of storage.
Memory (Random-Access Memory - RAM)
Memory consists of an ordered sequence of bytes used as the workspace for running programs and active data.
Every program and its associated data must be loaded into memory before the CPU can execute it.
Unique Addresses: Each byte in memory has a unique numeric address used to locate and access data.
Random-Access Memory (RAM): Bytes in memory can be accessed directly in any random sequence.
Typical RAM Capacity: Modern personal computers typically contain at least of RAM, commonly ranging between and .
Key Memory Characteristics:
Volatility: RAM is volatile storage. All stored information is lost when system power is switched off.
Non-emptiness: Memory bytes are never empty; their initial contents may be meaningless leftover bits.
Overwriting: Placing new data into a memory byte completely overwrites and erases its previous content.
Physical Fabrication: Built on silicon semiconductor chips containing millions of transistors. Compared to CPUs, memory chips are simpler, slower, and less expensive.
Storage Devices
Permanent (non-volatile) storage where programs and data are preserved even when system power is turned off.
Data is transferred from permanent storage devices into RAM when the computer executes programs or manipulates data.
Drives and Media: A storage drive is an operating mechanism that reads data from and writes data onto a physical storage medium.
Major Storage Device Types:
Magnetic Disk Drives (Hard Disks): Primary internal non-volatile storage. Capacities in modern computers range from to . External removable hard drives are also available.
Optical Disc Drives:
Compact Disc (CD): Holds up to of data. Types include CD-R (Compact Disc-Recordable, read-only permanent storage) and CD-RW (Compact Disc-ReWritable, acts like a hard drive where data can be overwritten).
Digital Versatile Disc / Digital Video Disc (DVD): Holds significantly more data than a CD, with a standard single-layer capacity of . Types include DVD-R (read-only) and DVD-RW (rewritable).
USB Flash Drives:
Connects via Universal Serial Bus (USB) ports, which allow connecting peripherals (printers, cameras, mice, external drives).
Small, portable solid-state storage devices with capacities available up to .
Input and Output Devices
Input Devices: Enable users to feed data and commands into the computer.
Keyboard: Primary text/command entry device. Contains:
Function Keys: Located along the top edge, prefaced with letter (-). Functions depend on active software.
Modifier Keys: Keys such as , , and that modify another key's behavior when pressed concurrently.
Numeric Keypad: Calculator-style cluster on the right side for rapid numerical input.
Arrow Keys: Positioned between main keyboard and numeric keypad for screen navigation.
Editing Keys: , , , and keys used for text/object insertion, deletion, and scrolling.
Mouse: Pointing device used to move an on-screen graphical arrow called a cursor and click buttons or interface controls.
Output Devices: Display or present information produced by the computer.
Monitor: Displays visual output (text and graphics). Quality is determined by:
Screen Resolution: The number of horizontal and vertical pixels ("picture elements"). Example: resolution on a 17-inch screen means 1,024 pixels wide by 768 pixels high. Higher resolution delivers sharper image clarity.
Dot Pitch: The physical distance between individual pixels measured in millimeters (). Smaller dot pitch values produce sharper displays.
Printer: Produces hard-copy output on paper.
Communication Devices
Enable computers to connect and communicate over local networks or the Internet.
Dial-up Modem: Uses standard telephone lines; maximum data transfer speed is (bits per second).
Digital Subscriber Line (DSL): Uses standard phone lines but transfers data up to faster than standard dial-up modems.
Cable Modem: Uses cable television lines provided by cable operators; generally faster than DSL.
Network Interface Card (NIC): Hardware device connecting a computer to a Local Area Network (LAN) (commonly deployed in universities, businesses, and government agencies). High-speed 1000BaseT cards transfer data at speeds up to (million bits per second).
Wireless Adapter: Enables cable-free connection to local wireless networks and the Internet.
Programming Languages
Computer programs are written in programming languages. Hundreds of programming languages exist, created to streamline software creation for human developers. All code must ultimately be converted into machine instructions that the computer's CPU can execute.
Machine Language
A computer's native, built-in primitive language consisting of binary code instructions (s and s).
Differs across different computer hardware architectures.
Example addition instruction in machine binary code:
1101101010011010.Programming in machine language is extremely tedious, highly error-prone, and virtually unreadable for humans.
Assembly Language
Developed as a low-level alternative to raw binary machine code in the early days of computing.
Replaces binary codes with short descriptive symbolic words called mnemonics.
Examples: Mnemonic
addrepresents addition;subrepresents subtraction.Example assembly statement:
add 2, 3, result.
Assembler: A translation program that converts assembly language code into binary machine code.
Assembly language is classified as a low-level language because its instructions map directly to underlying machine instructions, requiring intimate knowledge of CPU hardware architecture.
High-Level Languages
Developed beginning in the 1950s to make programming English-like, intuitive, and platform-independent.
Program instructions in high-level languages are called statements.
Example high-level language statement computing a circle's area ():
area = 5 * 5 * 3.14159;Platform Independence: High-level language code can run on diverse CPU architectures without modification.
High-Level Languages Overview:
Ada: Named for Ada Lovelace; developed for the U.S. Department of Defense; heavily used in defense software.
BASIC: Beginner's All-purpose Symbolic Instruction Code; designed for easy learning by novices.
C: Developed at Bell Laboratories; combines low-level hardware control of assembly with high-level language portability.
C++: Object-oriented expansion of C.
C#: Developed by Microsoft; object-oriented hybrid combining features of Java and C++.
COBOL: Common Business Oriented Language; designed specifically for business applications.
FORTRAN: FORmula TRANslation; popular for scientific, engineering, and mathematical computing.
Java: Originally created by Sun Microsystems (now Oracle); widely used for platform-independent web, desktop, server, and mobile software.
Pascal: Named for Blaise Pascal; simple, structured language created primarily for teaching programming principles.
Python: Simple, general-purpose scripting language popular for rapid program development.
Visual Basic: Developed by Microsoft for rapid development of Graphical User Interface (GUI) applications.
Translation: Interpreters vs. Compilers
Source Program / Source Code: A program written in a high-level language.
Because CPUs cannot directly execute high-level source code, it must be translated into binary machine code using either an interpreter or a compiler.
Interpreter:
Reads one statement from source code, translates it into machine code or virtual machine code, and executes it immediately.
A single high-level statement may translate into multiple low-level machine instructions.
Compiler:
Translates the entire source code file at once into a machine-code output file.
The generated machine-code file is subsequently executed independently.
Operating Systems
The Operating System (OS) is the most crucial system program running on a computer.
It manages and controls all hardware operations, system resources, and software activities.
Application software (word processors, web browsers) cannot run without an active underlying OS.
Major general-purpose operating systems: Microsoft Windows, Mac OS, Linux.
System Layering: User Application Programs Operating System Hardware.
Key OS Responsibilities
Controlling and Monitoring System Activities:
Handles basic tasks: recognizing keyboard input, directing output to display monitors, tracking files/folders on storage media, controlling peripherals (printers, disk drives).
Prevents concurrent programs and users from interfering with one another.
Maintains system security by restricting access to authorized users and programs.
Allocating and Assigning System Resources:
Identifies resource requirements of programs (CPU time, RAM space, disk storage, I/O devices) and dynamically assigns them during execution.
Scheduling Operations:
Schedules program execution to maximize resource utilization efficiency through advanced execution techniques:
Multiprogramming: Allows multiple applications to share a single CPU concurrently. Because the CPU operates vastly faster than I/O devices, it remains idle while awaiting disk transfers; multiprogramming uses this idle CPU time to execute statements from other applications (e.g., editing a document while downloading a web file).
Multithreading: Allows a single application to execute multiple concurrent subtasks (e.g., editing text while saving a document to disk simultaneously within the same word processor).
Multiprocessing (Parallel Processing): Uses two or more physical CPUs working in parallel to perform program subtasks concurrently, joining their results to solve the primary task.
Java, the World Wide Web, and Beyond
Origins and History:
Created by a team led by James Gosling at Sun Microsystems.
Initiated in 1991 under the name Oak, designed for embedded microchips in consumer electronic appliances.
Redesigned in 1995 and renamed Java, targeting Web application development.
Sun Microsystems was acquired by Oracle in 2010.
Design Goals and Core Characteristics:
Primary Philosophy: Write Once, Run Anywhere (WORA).
Defined characteristics: Simple, object-oriented, distributed, interpreted, robust, secure, architecture-neutral, portable, high-performance, multithreaded, dynamic.
Web and Software Ecosystem:
Applets: Java programs embedded inside HTML web pages that execute within web browsers, offering graphical user interfaces (buttons, text fields, radio buttons) to make web pages interactive.
HTML (Hypertext Markup Language): Simple markup language for laying out documents and multimedia on the Web.
Rich Internet Applications (RIAs): Web applications delivering complex features and performance equivalent to desktop software.
Server-Side Applications: Backend web applications processing business logic, computing data, and serving dynamic web content.
Android Platform: Software applications for Android cellular phones are built using Java.
Space Exploration: Java code was utilized to control and communicate with the robotic Mars rover.
Java Standards and Tools: Language Specification, API, JDK, and IDE
Java Language Specification: Technical definition detailing Java syntax and semantics.
Application Programming Interface (API) / Library: Predefined collection of Java classes and interfaces available for developing software.
Java Editions:
Java Standard Edition (Java SE): Core foundation for developing client-side desktop applications and applets.
Java Enterprise Edition (Java EE): Platform for server-side enterprise applications (Java servlets, JavaServer Pages/JSP, JavaServer Faces/JSF).
Java Micro Edition (Java ME): Platform for mobile and embedded devices (cell phones).
Version Naming:
Java SE 8 utilizes the Java Development Toolkit (JDK) named JDK 1.8 (also referred to as Java 8 or JDK 8).
Development Tools:
JDK: A bundle of command-line tools for compiling, testing, and executing Java programs.
Integrated Development Environment (IDE): Software providing an all-in-one Graphical User Interface (GUI) combining text editing, compiling, building, debugging, and execution (e.g., NetBeans, Eclipse, TextPad).
IDEs are development tools; they are NOT distinct dialects or language extensions of Java.
Anatomy of a Simple Java Program
Console Terminology:
Console: Historical computer term referring to text entry and display hardware.
Console Input: Receiving user input typed via the keyboard.
Console Output: Displaying text output on the monitor screen.
Listing 1.1: Welcome.java
public class Welcome {
public static void main(String[] args) {
// Display message Welcome to Java! on the console
System.out.println("Welcome to Java!");
}
}
Program Components Breakdown
Class Definition (
public class Welcome):Every Java program must contain at least one class.
Class names begin with an uppercase letter by convention (e.g.,
Welcome).File naming rule: The source file name MUST match the public class name exactly, appending
.java(Welcome.java).
Main Method (
public static void main(String[] args)):Program execution starts at the
mainmethod entry point.mainresides inside a class block and contains executable program statements.
Console Output Statement (
System.out.println("Welcome to Java!");):Displays the specified text string on the console screen.
String: A literal sequence of characters enclosed in double quotation marks (
"...").Statement Terminator: Every statement in Java ends with a semicolon (
;).
Reserved Words (Keywords):
Words reserved by the Java compiler with predefined meanings (e.g.,
public,class,static,void). Cannot be reused as variable or class names.
Comments:
Explanatory notes ignored by the compiler.
Line Comment: Preceded by
//on a single line.Block Comment: Enclosed between
/*and*/across one or multiple lines.Javadoc Comment: Enclosed between
/**and*/; extracted into HTML reference files using the JDKjavadoccommand.
Blocks and Braces:
A block is formed by curly braces (
{ ... }) grouping class or method statements.Every opening brace
{must have a matching closing brace}.
Case Sensitivity: Java is strictly case-sensitive (
mainis valid;Maincauses compile/runtime errors).
Special Characters Reference
{}(Opening and closing braces): Denote a code block enclosing statements.()(Opening and closing parentheses): Used with methods.[](Opening and closing brackets): Denote an array.//(Double slashes): Precede a line comment.""(Double quotation marks): Enclose literal character strings.;(Semicolon): Marks the end of a statement (statement terminator).
Creating, Compiling, and Executing a Java Program
Program Development Cycle:
Write Source Code: Create code in a
.javafile using a text editor (e.g., Notepad) or an IDE.Compile Source Code: Run compiler command
javac ClassName.java. Translates source code into Java Bytecode saved in a.classfile.Execute Bytecode: Run interpreter command
java ClassName. Invokes the Java Virtual Machine (JVM) to interpret bytecode into target machine code step-by-step.
Java Virtual Machine (JVM)
Java bytecode is a low-level, architecture-neutral code that can execute on any computer platform containing a JVM.
Class Loader: Program within JVM that dynamically loads needed
.classbytecode files into memory.Bytecode Verifier: Checks bytecode validity and verifies security rules to prevent host machine damage.
Common Command-Line Execution Errors
Executing command
java ClassName.classraises an error because the system attempts to openClassName.class.class.NoClassDefFoundError: Raised when executing a.classfile that does not exist in the working directory.NoSuchMethodError: Raised when executing a class file that lacks a validmainmethod (or wheremainis misspelled asMain).
Programming Style and Documentation
Proper programming style and documentation prevent bugs and make programs readable and maintainable.
Document Summary: Include a summary block at the beginning of files explaining purpose, features, and key techniques.
Javadoc Comments (
/** ... */): Place directly before class or method headers to enable automated HTML documentation generation.Indentation and Spacing:
Indent nested statements at least 2 spaces deeper than their enclosing block.
Place single spaces on both sides of binary operators (e.g.,
3 + 4 * 4instead of3+4*4).
Block Styles:
Next-Line Style: Aligns opening brace
{on a new line aligned vertically with the header.End-Of-Line Style: Places opening brace
{at the end of the header line (standard Java API style, saves vertical screen space).
Programming Errors
Categories of Errors
Syntax Errors (Compile Errors):
Violations of language structure rules (e.g., missing semicolons, missing quotation marks, mismatched braces, misspelled keywords).
Detected and reported by the compiler before program execution.
Best practice: Fix reported syntax errors starting from the top error message downwards.
Runtime Errors:
Causes abnormal program termination while running.
Occurs when the environment detects impossible operational requests (e.g., integer division by zero
1 / 0, invalid data input types).
Logic Errors:
Program compiles and runs to completion without crashing, but yields incorrect results due to flawed logic.
Example: Computing integer division
(9 / 5) * 35 + 32yields67instead of95.0because integer9 / 5truncates the fraction to1. Using floating-point literal(9.0 / 5) * 35 + 32corrects the error.
Common Beginner Errors
Missing closing braces
}.Missing semicolons
;(statement terminators).Missing closing quotation marks
"in strings.Misspelling names/keywords (e.g., writing
Maininstead ofmain, orstringinstead ofString).
IDE Development Workflows
NetBeans Workflow
Create Project: File New Project Categories: Java, Projects: Java Application Next Specify Project Name and Location Finish.
Create Class: Right-click project node New Java Class Specify Class Name (e.g.,
Welcome) Finish.Compile and Run: Right-click file Run File (or press
Shift + F6). NetBeans compiles modified files automatically before execution.
Eclipse Workflow
Create Project: File New Java Project Enter Project Name (e.g.,
demo) Select "Use project folder as root for sources and class files" Finish.Create Class: File New Class Type Name (e.g.,
Welcome) Checkpublic static void main(String[] args)Finish.Compile and Run: Right-click class file Run As Java Application. Output displays in the Console window.
Review Checkpoint Questions and Answers
1.1 What are hardware and software?
Hardware is the physical, tangible computer components; software consists of the invisible instructions controlling hardware.
1.2 List five major hardware components of a computer.
CPU, memory (RAM), storage devices, input devices, output devices, communication devices.
1.3 What does the acronym "CPU" stand for?
Central Processing Unit.
1.4 What unit is used to measure CPU speed?
Hertz (Hz), Megahertz (MHz), and Gigahertz (GHz).
1.5 What is a bit? What is a byte?
A bit is a binary digit ( or ). A byte is a binary storage unit consisting of .
1.6 What is memory for? What does RAM stand for? Why is memory called RAM?
Memory holds data and instructions for CPU execution. RAM stands for Random-Access Memory. It is called RAM because bytes can be accessed in any random order.
1.7 What unit is used to measure memory size?
Bytes, kilobytes (KB), megabytes (MB), gigabytes (GB), terabytes (TB).
1.8 What unit is used to measure disk size?
Gigabytes (GB) and terabytes (TB).
1.9 What is the primary difference between memory and a storage device?
Memory is volatile (temporary, fast workspace lost on power-off); storage devices are non-volatile (permanent, slower storage).
1.10 What language does the CPU understand?
Machine language (binary code).
1.11 What is an assembly language?
A low-level programming language using symbolic mnemonics to represent binary machine instructions.
1.12 What is an assembler?
A utility program that translates assembly language code into binary machine code.
1.13 What is a high-level programming language?
An English-like, platform-independent programming language whose statements compute tasks.
1.14 What is a source program?
A program written in a high-level language.
1.15 What is an interpreter?
A translator that reads, converts, and executes source code statements line-by-line.
1.16 What is a compiler?
A program that translates an entire high-level source code file into a machine-code file.
1.17 What is the difference between an interpreted language and a compiled language?
Interpreted languages execute source statements immediately line-by-line; compiled languages generate a separate machine-code file for execution.
1.18 What is an operating system? List some popular operating systems.
The master system program controlling computer hardware and software. Popular systems: Microsoft Windows, Mac OS, Linux.
1.19 What are the major responsibilities of an operating system?
Controlling/monitoring system activities, allocating/assigning resources, and scheduling operations.
1.20 What are multiprogramming, multithreading, and multiprocessing?
Multiprogramming shares one CPU across multiple programs. Multithreading runs concurrent tasks within a single program. Multiprocessing executes subtasks across multiple physical processors in parallel.
1.21 Who invented Java? Which company owns Java now?
Created by James Gosling's team at Sun Microsystems; currently owned by Oracle.
1.22 What is a Java applet?
A Java program embedded in HTML pages designed to run inside web browsers.
1.23 What programming language does Android use?
Java.
1.24 What is the Java language specification?
The formal technical document defining Java syntax and semantics.
1.25 What does JDK stand for?
Java Development Toolkit.
1.26 What does IDE stand for?
Integrated Development Environment.
1.27 Are tools like NetBeans and Eclipse different languages from Java, or are they dialects or extensions of Java?
They are IDE tools for software development, not dialects or extensions of Java.
1.28 What is a keyword? List some Java keywords.
Words reserved by the compiler with fixed meanings (
class,public,static,void).
1.29 Is Java case sensitive? What is the case for Java keywords?
Yes, Java is strictly case-sensitive. All Java keywords are lowercase.
1.30 What is a comment? Is the comment ignored by the compiler? How do you denote a comment line and a comment paragraph?
Explanatory program notes ignored by the compiler. Line comment:
//. Block comment paragraph:/* ... */.
1.31 What is the statement to display a string on the console?
System.out.println("...");
1.32 Show the output of the following code:
public class Test {
public static void main(String[] args) {
System.out.println("3.5 * 4 / 2 2.5 is ");
System.out.println(3.5 * 4 / 2 - 2.5);
}
}
```
- Output:
`3.5 * 4 / 2 2.5 is `
`4.5` (Computed as ).
- **1.33 What is the Java source filename extension, and what is the Java bytecode filename extension?**
- Source extension: `.java`. Bytecode extension: `.class`.
- **1.34 What are the input and output of a Java compiler?**
- Input: `.java` source file. Output: `.class` bytecode file.
- **1.35 What is the command to compile a Java program?**
- `javac ClassName.java`
- **1.36 What is the command to run a Java program?**
- `java ClassName`
- **1.37 What is the JVM?**
- Java Virtual Machine (software interpreter executing Java bytecode).
- **1.38 Can Java run on any machine? What is needed to run Java on a computer?**
- Yes, provided a JVM compatible with the machine platform is installed.
- **1.39 If a `NoClassDefFoundError` occurs when you run a program, what is the cause of the error?**
- The specified class file cannot be located.
- **1.40 If a `NoSuchMethodError` occurs when you run a program, what is the cause of the error?**
- The class file lacks a properly declared `main` method.
- **1.41 Reformat the following program according to style guidelines using end-of-line brace style:**
java public class Test { // Main method public static void main(String[] args) { /** Display output */ System.out.println("Welcome to Java"); } } ```
1.42 What are syntax errors, runtime errors, and logic errors?
Syntax: Language structure rule violations (e.g., missing semicolon).
Runtime: Environment execution errors causing abnormal crash (e.g., division by zero).
Logic: Flawed logic leading to wrong results without crashing.
1.43 If you forget to put a closing quotation mark on a string, what kind of error will be raised?
Syntax error (compile error).
1.44 If your program needs to read integers, but the user entered strings, what kind of error occurs?
Runtime error.
1.45 Suppose you write a program for computing the perimeter of a rectangle and mistakenly compute the area. What kind of error is this?
Logic error.
1.46 Identify and fix errors in:
java public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); } } Errors fixed: Added
staticand return typevoidtomain; changed single quotes'to double quotes"around the string.
Chapter Programming Exercises Summary and Mathematical Equations
Exercise 1.1 (Display three messages): Program displaying
Welcome to Java,Welcome to Computer Science, andProgramming is fun.Exercise 1.2 (Display five messages): Program displaying
Welcome to Javafive times.Exercise 1.3 (Display a pattern): Program displaying pattern spelling
JAVAusing letter combinations.Exercise 1.4 (Print a table): Program outputting a grid of numbers , , and for .
Exercise 1.5 (Compute expressions): Program computing:
Exercise 1.6 (Summation of a series): Program computing:
Exercise 1.7 (Approximate ): Program calculating:
Exercise 1.8 (Area and perimeter of a circle): Program computing circle values ():
Exercise 1.9 (Area and perimeter of a rectangle): Program computing rectangle values (, ):
Exercise 1.10 (Average speed in miles): Program calculating average speed in miles per hour ( run in ; ).
Exercise 1.11 (Population projection): Program computing 5-year population projections starting from current population () given:
1 birth every .
1 death every .
1 new immigrant every .
Exercise 1.12 (Average speed in kilometers): Program computing average speed in kilometers per hour ( run in ).
Exercise 1.13 (Algebra: solve linear equations): Using Cramer's rule to solve: Applied to equation system: and .