Welcome to AP Computer Science A We use the Java language, but this class is much more rigorous than Intro to Java More programming, but also more theory.

Slides:



Advertisements
Similar presentations
Introduction to Computing Concepts Note Set 7. Overview Variables Data Types Basic Arithmetic Expressions ▫ Arithmetic.
Advertisements

 2005 Pearson Education, Inc. All rights reserved Introduction.
1 Chapter 2 Introduction to Java Applications Introduction Java application programming Display ____________________ Obtain information from the.
Primitive Data Types There are a number of common objects we encounter and are treated specially by almost any programming language These are called basic.
Introduction to Programming with Java, for Beginners Primitive Types Expressions Statements Variables Strings.
10-Jun-15 Introduction to Primitives. 2 Overview Today we will discuss: The eight primitive types, especially int and double Declaring the types of variables.
CMT Programming Software Applications
1 9/20/06CS150 Introduction to Computer Science 1 Review: Exam 1.
 2002 Prentice Hall. All rights reserved. 1 Intro: Java/Python Differences JavaPython Compiled: javac MyClass.java java MyClass Interpreted: python MyProgram.py.
CS31: Introduction to Computer Science I Discussion 1A 4/2/2010 Sungwon Yang
Variables, Data Types, & Arithmetic Expressions CSC 1401: Introduction to Programming with Java Lecture 3 Wanda M. Kunkle.
An intro to programming The basic nitty-gritty that’ll make you scratch your head and say, “This is programming?”
1 Key Concepts:  Data types in C.  What is a variable?  Variable Declaration  Variable Initialization  Printf()  Scanf()  Working with numbers in.
Libraries Programs that other people write that help you. #include // enables C++ #include // enables human-readable text #include // enables math functions.
Hello, world! Dissect HelloWorld.java Compile it Run it.
String Escape Sequences
1 The First Step Learning objectives write Java programs that display text on the screen. distinguish between the eight built-in scalar types of Java;
110-D1 Variables, Constants and Calculations(1) Chapter 3: we are familiar with VB IDE (building a form…) to make our applications more powerful, we need.
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
1 Variables, Constants, and Data Types Primitive Data Types Variables, Initialization, and Assignment Constants Characters Strings Reading for this class:
Review Review Review. Concepts Comments: definition, example, different types of comments Class: definition, example Object: definition, example Data.
CSCI 1100/1202 January 16, Why do we need variables? To store intermediate results in a long computation. To store a value that is used more than.
PYTHON: PART 2 Catherine and Annie. VARIABLES  That last program was a little simple. You probably want something a little more challenging.  Let’s.
CS1 Lesson 2 Introduction to C++ CS1 Lesson 2 -- John Cole1.
Introduction to Java Applications Part II. In this chapter you will learn:  Different data types( Primitive data types).  How to declare variables?
JAVA BASICS: Variables and References SYNTAX, ERRORS, AND DEBUGGING.
Outline Character Strings Variables and Assignment Primitive Data Types Expressions Data Conversion Interactive Programs Graphics Applets Drawing Shapes.
5 BASIC CONCEPTS OF ANY PROGRAMMING LANGUAGE Let’s get started …
Chapter 2: Java Fundamentals
Introduction to Programming David Goldschmidt, Ph.D. Computer Science The College of Saint Rose Java Fundamentals (Variables, Arithmetic, etc.)
 Pearson Education, Inc. All rights reserved Introduction to Java Applications.
Agenda Object Oriented Programming Reading: Chapter 14.
College Board A.P. Computer Science A Topics Program Design - Read and understand a problem's description, purpose, and goals. Procedural Constructs.
Primitive Data Types. Identifiers What word does it sound like?
02 Variables1November Variables CE : Fundamental Programming Techniques.
CHAPTER # 2 Part 2 PROGRAMS AND DATA 1 st semster King Saud University College of Applied studies and Community Service CSC1101 By: Asma Alosaimi.
ECE 122 Feb. 1, Introduction to Eclipse Java Statements Declaration Assignment Method calls.
Copyright Curt Hill Variables What are they? Why do we need them?
VARIABLES Programmes work by manipulating data placed in memory. The data can be numbers, text, objects, pointers to other memory areas, and more besides.
Chapter 2 Variables.
Chapter 2 Input, Variables and Data Types. JAVA Input JAVA input is not straightforward and is different depending on the JAVA environment that you are.
Programming Fundamentals. Overview of Previous Lecture Phases of C++ Environment Program statement Vs Preprocessor directive Whitespaces Comments.
Data Tonga Institute of Higher Education. Variables Programs need to remember values.  Example: A program that keeps track of sales needs to remember.
CHAPTER 2 PROBLEM SOLVING USING C++ 1 C++ Programming PEG200/Saidatul Rahah.
Introduction to Java Applications Part II. In this chapter you will learn:  Different data types( Primitive data types).  How to declare variables?
Values, Types, and Variables. Values Data Information Numbers Text Pretty much anything.
UFCFY5-30-1Multimedia Studio Coding for Interactive Media Fundamental Concepts.
Lecture 3: More Java Basics Michael Hsu CSULA. Recall From Lecture Two  Write a basic program in Java  The process of writing, compiling, and running.
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
Copyright © Texas Education Agency, Computer Programming Variables and Data Types.
Chapter 2 Variables.
Chapter Topics The Basics of a C++ Program Data Types
Chapter 2 Basic Computation
Basic Elements of C++.
Introduction to Python Data Types and Variables
Multiple variables can be created in one declaration
Introduction to C++ October 2, 2017.
Basic Elements of C++ Chapter 2.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Variables ICS2O.
Chapter 2 Variables.
Welcome to AP Computer Science A!
Welcome to AP Computer Science A!
Other types of variables
Primitive Types and Expressions
Unit 3: Variables in Java
Chapter 2 Variables.
Data Types Every variable has a given data type. The most common data types are: String - Text made up of numbers, letters and characters. Integer - Whole.
C Programming Lecture-3 Keywords, Datatypes, Constants & Variables
Variables and Constants
Presentation transcript:

Welcome to AP Computer Science A We use the Java language, but this class is much more rigorous than Intro to Java More programming, but also more theory Difficult material…expect to study/practice at home if you want to succeed AP Exam: May 2016… college credit  save $$ and time, impressive on application, be more prepared for college cbsd.org  teacher websites  Quinn –Notes, assignments, and test/quiz dates will be posted here. When you miss class, it is YOUR responsibility to read the notes and complete the assignments.

Do not… Copy code/files Google how to do something Play games / do anything before all assignments are done Ask “did you grade the tests yet?” or any variation thereof Listen to the band Third Eye Blind

Don’t be “that guy”

Rules for naming a file –Begin with a capital letter –No spaces or punctuation –Cannot begin with a number –Each new word starts with a capital letter

Basic output To display text: System.out.println(“ “); To go to the next line: put \n between the quotes System.out.print(“ “);  do not go to next line Java is case-sensitive Semi-colons after (almost) every line of code Demo: HelloWorld

Variables Variables are memory containers in which info is stored They can hold numbers, letters, words, phrases, etc integers are whole numbers (no decimals) First, declare the variable – specify the type of info the variable will hold, and give the variable a name int x = 0; Setting it equal to zero is called initializing the variable (giving it an initial value) Integers are usually initialized to 0, although there are exceptions to this rule Demo

You give a variable a value by using =, which is called the assignment operator. Important: = does not mean “is equal to!” What it really means is “Take what is on the right side of the equals sign and assign it to what is on the left side.”

Rules for naming variables Use meaningful names Cannot start with a number Numbers and letters only Start with a lowercase letter then capitalize the first letter of other words Examples: highScore avgTestScore

Other types of variables Double (also known as “floating point number”) –allows decimals –much more useful than integers, but takes up more memory char –A single character –You must put the character in single quotes, if you are giving a char value in your code example: char myGrade = ‘ ’; String –Words, phrases, sentences –Capitalize String –Use double quotes example: String firstName= “”; Demo

Assignments (MyInfo) –Declare and initialize variables that will hold… Your age 7 numbers The average of those 7 numbers The sum, difference, product, and quotient of the first and last numbers your middle initial Your favorite book –Store data in these variables. –Then display this information. (Example: “The average is 3.4.”)