PT - Primitive Types Overview

APCompSci_OverviewBanner.png

Primitive Types

Introduction

Do you ever wonder how computer programs and phone apps solve problems? You may think that computer science is all about programming, but it is actually about problem solving. Using technology to solve a problem is the backbone of computer science. Think of programming as a foreign language – computers speak programming languages, so our job is to come up with a solution to a problem and translate it to a language the computer understands…

Welcome to AP Computer Science!

In this course we will learn about the Java programming language and the use of classes. (Not the classes you take in high school, but classes that we write in Java.)

As a consumer of technology, understanding the basic fundamentals of computers is priceless! Learning how computers process and store data as well as how they produce output is important for any programmer. Understanding how data is represented, the different types of data, and the types of errors that often occur is necessary.

We will learn about 3 main data types and how to create variables, store variables, and interact with those variables using basic operations. Think about how numbers are used in the programs and apps you use most often. How are mathematical concepts being used in your favorite programs and apps? Once you gain an understanding of the basics of how computers work and how programmers write programs you will be able to write your first program!

Module Lessons Preview

In this module, we will study the following topics:

Why Programming?  Why Java?: What is Java and why are we using it? We will explore those questions and set up our computers with the development environment that we will use throughout the course.

Variables and Data Types: There are many different data types in Java. We will learn about the different data types in java and which ones will be tested on the AP Exam. We will also learn how to create and use variables in basic programs.

Expressions and Assignment Statements: Variables can be created and assigned in many ways. Once we create variables and assign them values, we can use them in expressions. This is not your math class. Java keeps things as streamlined as possible.

Compound Assignment Operators: Talk about streamlined. You didn’t think it could get any shorter but with compound expressions we will shorten assignment operators even more. We will practice mathematical operators and take it to the next level using compound operators.

Casting and Ranges of Variables: Data can start out as one type and end up as another. There are ways to narrow and widen data. Even though data can change types there are limits. Nothing lasts forever.

Key Terms

case sensitive – distinguishing upper and lowercase characters.

class – a programmer-defined data type.

comment – an explanation to help the human reader understand a section of a program.

concatenation – placing one String after another to form a new String.

keywords – words that have special meanings in a programming language and therefore cannot be used as a name by a programmer.

method – a sequence of statements that has a name, may have formal parameters, and may return a value.

primitive types – in Java, a number type or boolean.

statements – a syntactical unit in a program.

String – a sequence of characters.

variable – a name in a program that identifies a storage location that can hold different values.

APCompSci_OverviewBottom.png  IMAGES CREATED BY GAVS