Exhaustive Computer Science Fundamentals and Java Programming Study Guide

Fundamentals of Programming and Computer Programs

  • Programming: Instructions for doing something, or a list of things to do in order of events.
  • Computer Programming: Writing something in a computer language to solve a problem. It encompasses the entire process of planning and writing a computer program.
  • Computer Program: A sequence of instructions that run on a computer to solve a problem.
  • Data: Information that can be thought of as input; what is going into the program so that it can perform an action or accomplish a task.
  • Algorithm: A step-by-step solution to a problem written in English. It is a detailed, ordered list of specific instructions that need to be carried out to solve the problem.

The Programming Process

  • Overall Programming Process: The comprehensive workflow used to plan, create, and refine computer programs.
  • Problem-Solving Phase: The initial planning stage of programming focused on asking questions about the problem to achieve a deeper understanding.
    • Ask Questions: The foundational action taken to gain a complete understanding of the problem and collect all necessary details.
    • Design and Write an Algorithm: Creating a specific, highly detailed, ordered sequence of instructions written in English that outlines how to solve the problem.
  • Implementation Phase: The stage where the detailed sequence of English steps is translated into Java (producing a source program).
    • Code a Program in a Programming Language: The explicit step of writing the initial English instructions into Java code.
    • Test the Program, Debug the Program, Use the Program: The essential operations involved in identifying and fixing issues within the programs, which serves as the key to getting a program to run properly.

Object-Oriented Programming Concepts

  • Object-Oriented Programming (OOP): A programming paradigm organized around abstract blueprints and concrete instances.
  • Class:
    • The abstract, detailed blueprint for an object.
    • Serves as the blueprint for what the program will use and the structural blueprint for creating objects.
    • A single class has the flexibility to solve multiple problems.
  • Attribute: A characteristic of an object or class, typically represented as a noun.
  • Method: An action performed by an object or class, typically represented as a verb.
  • Object: A concrete representation or instantiation of a class within a program.

Programming Language Structure and Statement Types

  • Programming Language: Consists of special words, special symbols, and specific rules known as syntax.
  • Command / Statement / Instruction: Terms that are synonymous and refer to the same concept. A single line of code typically contains one command.
  • Four Structural Patterns of Statements:
    1. Sequence: Executing commands in sequential order, one after another.
    2. Selection (Conditional, Branching): Making a choice based on conditions (such as an If, then statement).
    3. Looping (Repetition): Repeating an execution pathway more than once based on a specified choice or condition.
    4. Subprogram: Programs that invoke or call upon other programs to execute tasks.

Java Program Execution Pipeline and Components

  • Machine Language: The lowest-level language consisting entirely of 00's and 11's, which is what the physical computer actually executes.
  • Source Code: Program code written in Java, saved inside a file with a .java file extension. The file name must match the name of the class.
  • Compiler: Software that processes source code and translates it into bytecode.
  • Bytecode: The intermediate representation of a Java program stored in a file with a .class file extension (also related to object code).
  • Java Virtual Machine (JVM):
    • A software program rather than a physical hardware component.
    • Converts bytecode into machine language (00's and 11's) behind the scenes.
    • Software implementations of the JVM are device-specific.
  • Complete Translation Pipeline: English Algorithm→Java Source Program (.java)→Bytecode (.class)→Machine Language (0’s and 1’s)\text{English Algorithm} \rightarrow \text{Java Source Program (.java)} \rightarrow \text{Bytecode (.class)} \rightarrow \text{Machine Language (0's and 1's)}

Problem-Solving Strategies

  • Ask Questions: Inquire deeply into requirements to capture all details and fully understand the goal.
  • Look for Things That Are Familiar or Analogous: Identify structural similarities to problems solved previously.
  • Means-Ends Analysis: Analyze the gap between the initial state and the desired end goal to determine necessary intermediate steps.
  • Divide & Conquer (Building Block): Break a complex problem down into smaller, manageable sub-problems or building blocks.

Development Tools, Errors, and Environment Concepts

  • Editor: Software used to write and edit raw source code.
  • Integrated Development Environment (IDE):
    • Software platforms integrating text editors, compilers, and execution tools into one program.
    • Examples include jGrasp, Dr Java, and online environments such as Pickcode.
  • Java Development Kit (JDK): The comprehensive library and software development toolkit used to build Java applications.
  • Packages and Libraries: Pre-written collections of code, utilities, and classes that can be imported to extend program capabilities.
  • Main Method: The designated entry point where execution begins in a Java program.
  • Errors, Bugs, and Debugging:
    • Bugs: Faults or errors in a program that prevent it from running correctly.
    • Debugging: The active process of finding, analyzing, and fixing bugs within program code.
    • Syntax Errors: Violations of the specific rules and grammar of the programming language.
    • Logic Errors: Structural flaws in the algorithm or reasoning that cause correct syntax to yield incorrect results.
  • Java Flow Diagram: Architectural representation detailing compilation and program execution flow (such as Java Methods, Page 1919).