{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Math107Ch2

# Math107Ch2 - Introduction To Scientific Programming Chapter...

This preview shows pages 1–9. Sign up to view the full content.

Introduction To Scientific Programming Chapter 2

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
S.Horton/107/Ch. 2 Slide 2 Chapter 2 I. Computer Storage I. Primitive Data Types & Expressions I. Strings – Part I I. Keyboard & Screen (Console) I/O I. Software Development A. Defining Projects B. Setting up your own programming environment
S.Horton/107/Ch. 2 Slide 3 I. How A Computer Stores Information Everything on a computer is fundamentally stored as a one or a zero (irreducible state): Two state transistor (on/off) in silicon memory Magnetic pole orientation (up/down) in hard drive Reflection (pit/valley) in optical storage This single piece of binary (or digital) information is called a “bit”. Each storage location has an address and a value .

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
S.Horton/107/Ch. 2 Slide 4 Computer Storage (cont.) By convention, data is moved through the CPU in groups of 2, 8, 16, 32, or now 64 (powers of 2). The basic addressable unit is 8 bits = 1 “byte”. Today, storage is quoted in KB, MB, GB, or TB!
S.Horton/107/Ch. 2 Slide 5 Computer Numbering Systems You are probably most familiar with the decimal numbering system – i.e. (0-9) per digit. This is called a Base 10 system. This is only one of many possible “bases”. Binary numbering is Base 2 (0-1). The other important numbering system used extensively on computers, is Base 16, called hexadecimal (0-9,A-F).

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
S.Horton/107/Ch. 2 Slide 6 Basic Number Types In a program, you must declare a type for your data. The basic types are: int and long for integer numbers float and double for real numbers
S.Horton/107/Ch. 2 Slide 7 Java Declaration Examples Syntax: Type Variable_1, Variable_2, … ; Examples: int count; long i; float total; double marketValue; Variants include: int count = 0; long i = 1000L; float total = 1.0F; double marketValue = 1234.56D, interestRate = 5.75D;

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
S.Horton/107/Ch. 2 Slide 8 Character Representation The most common standard for character reference is known as ASCII which uses 8 bits to reference all individual characters. How many possibilities are there?
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}