Vous êtes sur la page 1sur 2

CS Notes Algorithm: step-by-step solution to a problem Program: An implementation of an algorithm that a computer can understand Abstraction o Split the

the problem into several problems o Each intermediate layer will: Use what its lower layer provides to do something Hide the characteristics of the layers below it to the layer above o The lower layers are in the hardware and the upper layers are in the software. Programming language o A language that allows you to express computations performed by a machine. o But a machine has several layers. Each layer has its own programming language o The language allows the functionality provided by a layer to be used without knowing how it is implemented. The language provides ways to represent and provide data. Data: a collection of logical bits Operations (instructions) Program: a sequence of instructions that provides a result. High Level Language o Uses data representations and constructs that are much easier to use to convert the high level computation steps (algorithm) to a computer program to achieve the desired functionality o Java

Scanner If System.out deals with printing stuff, then System.in.

A variable is a named storage location in the computers memory. A literal is a value that is written into the code of the program. Variable Declarations JRE system library allows the most basic of functions (adding, etc) JRE must be installed in order to run, but it can be installed anywhere.
System.out.println(y); /** * System is the basic intro. * The . after that tells it to go get the out function. * The . calls the println function.

Ctrl shift O: Organizes the imports Ctrl shift F: Fixes code after using select all Scanner keyboard = new Scanner(System.in); Primitive types automatically get its own space in memory. Complex types (scanners)(string is the exception) require Java to figure out how to make it. Scanner keyboard is the declaration (keyboard is the variable name) = mean that its an assignment == is a comparison New goes to get the blueprints on how to go get and create the scanner, etc The () after the scanner means it will read from the System.in (or the keyboard).

Letters and numbers are interchangeable; this is called casting. This is called casting, where you tell the computer to ignore the obvious and cast something as something else. You have to cast when you want to move from something more precise to less precise. Name equivalents and content equivalents are the same thing for primitive data types only. Content equivalents means that two complex types contain the same values Name equivalents means that the object is the exact same object in memory == does name equivalents.

Vous aimerez peut-être aussi