Presentation is loading. Please wait.

Presentation is loading. Please wait.

Welcome to AP Computer Science A!

Similar presentations


Presentation on theme: "Welcome to AP Computer Science A!"— Presentation transcript:

1 Welcome to AP Computer Science A!
Mr. Quinn

2 Agenda Introduction Software setup Lesson 1.1 (Variables, output, input) Guided Practice (1.1 Assignments) Time Permitting: Lesson 1.2 & Assignments Closure Activity Students will be able to: Declare, initialize, and use variables Output text to the console Input data from the user See how today's lesson fits into the unit and the course as a whole

3 Email to mquinn@cbsd.org
What name you prefer to be called What programming classes have you taken? What other programming skills do you have? 7 interesting facts about yourself

4 Syllabus Software setup

5 What is Computer Science?
Computer Science deals with the theory and methods of processing information in digital computers, the design of computer hardware and software, and the applications of computers.

6 What does a computer scientist do?
The work of computer scientists falls into three categories: designing and building software developing effective ways to solve computing problems, such as storing information in databases, sending data over networks or providing new approaches to security problems devising new and better ways of using computers and addressing particular challenges in areas such as robotics, computer vision, or digital forensics

7 Why study Comp Sci? Top 10 reasons from the ACM
It’s the highest-paying college major.

8 Why does this class use the Java language?
Java is (arguably) the most popular programming language worldwide Java uses Object-Oriented Programming (OOP) principles, which are used in many other languages (C++, Python, Perl, PHP) – so, if you know Java, it is relatively easy to learn any of the others. Java is used at 90% of Fortune 500 companies Java is used in many games and apps

9 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

10 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

11 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

12 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.”

13 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

14 Source Code vs. Bytecode
The code you write is called source code. It is saved in a file with the extension .java. Once you compile it, it is converted into bytecode, which is saved in a file with the extension .class. A program called the Java Virtual Machine understands and runs bytecode. At the lowest level, a computer only understands Machine Language, made up of ones and zeroes. Think of bytecode as an intermediate language between source code (high-level language) and Machine Language (low-level). So, the java compiler (in our case, Jcreator) converts your source code into language that the computer can execute.

15 Assignment #1 (MyInfo) Declare and initialize variables that will hold… your height (in inches) 7 numbers The sum of those 7 numbers (use arithmetic in your code to calculate this, DON’T calculate it yourself!) The average of those 7 numbers (again, use arithmetic) The product of the 2nd and last numbers (again, use arithmetic) The quotient of the 3rd and 4th numbers (arithmetic) In your code, store data in these variables. Do not ask the user to input this data – assign values to the variables in your code instead. Display the height, sum, average, product, and quotient using variables in your System.out lines. (For example, one result could look like, “The sum is 98.”)


Download ppt "Welcome to AP Computer Science A!"

Similar presentations


Ads by Google