Gain the essential skills for computer science using one of today's most popular programming languages, Java. This book will prepare you for AP CompSci Complete, but you don’t need to be sitting that class to benefit. Computer science has become a basic life skill that everyone is going to need to learn. Whether you are going into a career or side hustle in business, technology, creativity, architecture, or almost any other field, you will find coding and computer science play a role.
So when we learn programming we are going to focus on three things: what is the process; what is the syntax; and what is the flow. The process is represented as a flowchart. We will learn how to make these to help you plan out what you are going to do before you write a line of code. At first, the flowcharts will be pretty simple, but then they will get more complex. The syntax is the code: this is what you write that translates the process you create in a flowchart to the instructions that the computer can understand. Finally, there is the flow. This is where you trace through the code and see how the data and information it stores along the way changes. You can see how the operation of the program cascades from line to line. You will be building charts that will capture the programming flow so you can better understand how the computer processes code to make your next program easier to conceive and code.
Along the way to aid in the learning of the essential Java skills, there will be three kinds of project types throughout this book: business software projects for applications where you work for a company and need to complete an internal project for a team such as the sales, marketing, or data science teams; social good projects where you are working for non-profits or for agencies that are trying to research and provide solutions to economic, environmental, medical, or humanitarian projects; and game development projects for games based on player input, random chance, or other mechanics for the use of entertainment.
What is unique about computer science is how it has become a skill, and not just a career. While there are jobs and titles of “computer scientist”, the skill of computer science, and specifically programming, are almost everywhere. After reading and using this book, you'll have the essential skills to think like a computer scientist, even if you are not. As a result you’ll be of greater value to your clients, your company, and yourself.
-------------------------
Discover the primary building blocks of programming using the Java programming language
See terminology and best practices of software development
Work with object-oriented programming concepts
Use common-language definitions and examples to help drive understanding and comprehension of computer science fundamentals
------------------------------
Who This Book Is For
Those who want to learn programming and want to think like a computer scientist. Ideal for anyone taking AP CompSci Complete.
Author(s): Doug Winnie
Edition: 1
Publisher: Apress
Year: 2021
Language: English
Pages: 350
Tags: java computer science jdk algorithm
Table of Contents
About the Author
About the Technical Reviewer
Sprint 1: Introduction
What You Need
Sprint 2: Setting Up the Java JDK and IntelliJ
Coding Tools and IDEs
Installation and Setup
Install the JDK
Install IntelliJ
Sprint 3: Setting Up GitHub
GitHub
How GitHub Works
Lifecycle of a Repository
Sprint 4: Programming Languages
Origin of Programming
Forms of Programming
Machine Language
Interpreted
Compiled
Object-Oriented
Data
Functional
Scripting
Sprint 5: History and Uses of Java
Java Beginnings
Java’s Primary Goals
Uses of Java
Sprint 6: How Java Works
The Problem with Compiled Languages
The JVM and JRE
Compiling Java Bytecode
Precompiled Files
OpenJRE
Sprint 7: Flowcharting
Flowcharting Tools
Paper
Tablet and Stylus
Apps
Flowcharting Basics
Terminus
Process/Action
Input and Output
Decisions
Annotations
Other Shapes
Take Out the Trash
But Is It Really That Simple?
Sprint 8: Hello, World
Create Your IntelliJ Java Project
IntelliJ IDEA
First Time Only: Configure the JDK
Create Project
About Your Project
Coding Your Project
Writing Your First Program
Compile and Run Your First Program
Create Your Repo in GitHub
Upload Your Code to GitHub
Sharing Program Output
Sprint 9: Simple Java Program Structure
Sprint 10: Text Literals and Output
Text Output
Escape Sequences
Sprint 11: Value Literals
Literal Formatting
Sprint 12: Output Formatting
Decimal Formatters
Thousands Formatters
Currency Formatters
Spacing and Alignment Formatters
Multiple Items in Formatters
Sprint 13: Comments and Whitespace
Sprint 14: Abstraction of Numbers
Sprint 15: Binary
Binary Numbers
Bit Size and Values
Overflow
Sprint 16: Unicode
Text Encoding
ASCII + Unicode
Emoji
Sprint 17: Variables
Essentials of Variables
Code Examples
Sprint 18: Math!
Basic Operators
Order of Operations
String Concatenation
Code Examples
Sprint 19: Math Methods
Working with Simple Methods
Multiparameter Methods
Illegal Value Types in Methods
Math Constants
Code Examples
Sprint 20: Managing Type
Mixing Types in Evaluations
Numbers to Strings
Strings to Numbers
Casts
Cast Errors
Code Examples
Sprint 21: Random Numbers
Create a Random Number Generator
Random Integers
Random Decimals
Code Examples
Sprint 22: Capture Input
Hello, Scanner
Capturing Strings
Capturing Integers
Capturing Decimals
Code Examples
Sprint 23: Creating Trace Tables
It’s a Spreadsheet
Um. Why?
Sprint 24: Methods
Method Basics
Writing a Method
Call a Method
Method Flow
Code Guide
Code Examples
Sprint 25: Calling Methods Within Methods
Methods Within Methods
Infinite Methods
Code Examples
Sprint 26: Methods and Values
Accepting Values in Methods
Returning a Value
Overloading a Method
Code Guides
Code Examples
Sprint 27: Methods and Scope
Variable Scope Errors
Defining Class-Scoped Variables
Class Conflicts
Code Examples
Sprint 28: Boolean Values and Equality
Creating a Boolean Variable
Boolean Logic Operators
Altering a Boolean Value
Combining Logic with Evaluations
Compound Logic Operators
Code Examples
Sprint 29: Simple Conditional Statements
The if Statement
The else Statement
The else if Statement
Understanding Conditional Flow
Code Examples
Sprint 30: Matching Conditions with the switch Statement
Creating a switch Statement Code Block
Things to Look Out for with the switch Statement
Code Examples
Sprint 31: The Ternary Operator
The if-else Statement Equivalent
Converting to a Ternary Operator
Using the Ternary Operator Inline with Code
Code Examples
Sprint 32: The Stack and the Heap
Understanding the Stack
Understanding the Heap
Why This All Matters
Sprint 33: Testing Equality with Strings
When the Heap Throws Equality
How to Better Compare String Values
Code Examples
Sprint 34: Dealing with Errors
Coding to Catch Errors
“Catching” Specific Errors
Code Examples
Sprint 35: Documenting with JavaDoc
Using JavaDoc Syntax
Generating Documentation
Code Examples
Sprint 36: Formatted Strings
Creating a Formatted String Literal
Code Examples
Sprint 37: The while Loop
Create a while Loop
Code Examples
Sprint 38: Automatic Program Loops
Creating a Program Loop
Code Examples
Sprint 39: The do/while Loop
Creating a do…while Loop
Run at Least Once
Sprint 40: Simplified Assignment Operators
Combined Assignment
Increment and Decrement
Placement and Program Flow
Code Examples
Sprint 41: The for Loop
Creating a for Loop
Changing the Step
Code Examples
Sprint 42: Nesting Loops
Creating Nested Loops
Displaying as a Grid
Code Examples
Sprint 43: Strings as Collections
Creating Strings Using the String Class
Getting a String Length
Getting a Specific Character from a String
Finding a Character in a String
Extracting a Substring
Comparing Strings
Code Examples
Sprint 44: Make Collections Using Arrays
Creating an Array with Values
Getting a Value from an Array
Creating an Array by Size
Things to Avoid with Arrays
Getting the Number of Values in an Array
Looping Through an Array
Code Examples
Sprint 45: Creating Arrays from Strings
Delimited Strings
Splitting It Up
What About Numbers?
Code Examples
Sprint 46: Multidimensional Arrays
Define a Multidimensional Array
Assign Values to Multidimensional Arrays
Access Values in Multidimensional Arrays
Rectangular and Irregular Arrays
Code Examples
Sprint 47: Looping Through Multidimensional Arrays
Creating Nested Loops for Arrays
Code Examples
Sprint 48: Beyond Arrays with ArrayLists
Create an ArrayList
Add Items to ArrayLists
Get Elements in ArrayLists
Remove Elements from ArrayLists
Find Items in ArrayLists
Replace Items in ArrayLists
Get the Size of an ArrayList
Copy Elements to a New ArrayList
Clear an ArrayList
Code Examples
Sprint 49: Introducing Generics
Create an ArrayList with Generics
Typing Using Generics
Code Examples
Sprint 50: Looping with ArrayLists
Working with size() and get() Methods
Code Examples
Sprint 51: Using for…each Loops
Mechanics of a for…each Loop
This Is the Mechanics of the for…each Loop
ArrayLists Without Generics
Yep, Arrays Work Too
Code Examples
Sprint 52: The Role-Playing Game Character
What Is a Role-Playing Game Character?
Filling Out Our Character Sheet with Data
Classes, Instantiation, and Construction
Player Character Sheets
Fighter
Mage
Paladin
Priest
Sprint 53: Polymorphism
Creating a Class Hierarchy
Party Up—All the Same—but All Different at the Same Time
The Essential Tool: The Die
Class Hierarchy, Polymorphism, Abstract, and Static
Sprint 54: Make All the Things…Classes
Creating Some Class
Instantiate Thyself, Class!
Sprint 55: Class, Extend Thyself!
Sprint 56: I Don’t Collect Those; Too Abstract
Sprint 57: Access Denied: Protected and Private
Sprint 58: Interfacing with Interfaces
Sprint 59: All I’m Getting Is Static
Sprint 60: An All-Star Cast, Featuring Null
Index