ch17 - Data stored in variables and arrays is temporary Its...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1

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

View Full DocumentRight Arrow Icon
Data stored in variables and arrays is temporary It’s lost when a local variable goes out of scope or when the program terminates For long-term retention of data, computers use files . Computers store files on secondary storage devices hard disks, optical disks, flash drives and magnetic tapes. Data maintained in files is persistent data because it exists beyond the duration of program execution.
Background image of page 2
Ultimately, a computer processes data items as combinations of zeros and ones It’s simple and economical for engineers to build electronic devices that can assume two stable states—one representing 0 and the other representing 1 . The smallest data item in a computer can assume the value 0 or the value 1 . Such a data item is called a bit Short for “binary digit”—a digit that can assume one of two values.
Background image of page 3

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

View Full DocumentRight Arrow Icon
Programmers prefer to work with decimal digits (0–9), letters (A–Z and a–z), and special symbols (e.g., $, @, %, &, *, (, ), –, +, ", :, ? and / ). Known as characters . Character set the set of all the characters used to write programs and represent data items. Java uses Unicode characters that are composed of two bytes , each composed of eight bits Java type byte can be used to represent byte data. Unicode contains characters for many of the world’s languages.
Background image of page 4
Fields are composed of characters or bytes. A field is a group of characters or bytes that conveys meaning. Data items processed by computers form a data hierarchy that becomes larger and more complex in structure as we progress from bits to characters to fields, and so on.
Background image of page 5

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

View Full DocumentRight Arrow Icon
Typically, several fields compose a record (implemented as a class in Java). A record is a group of related fields. A file is a group of related records.
Background image of page 6
Background image of page 7

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

View Full DocumentRight Arrow Icon
To facilitate retrieving specific records from a file, at least one field in each record is chosen as a record key. A record key identifies a record as belonging to a particular person or entity and is unique to each record. Typically used to search and sort records. There are many ways to organize records in a file. The most common is called a sequential file , in which records are stored in order by the record-key field.
Background image of page 8
A group of related files is called a database . A collection of programs designed to create and
Background image of page 9

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

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/06/2010 for the course CS 2050 taught by Professor Uhlmann during the Fall '09 term at Missouri (Mizzou).

Page1 / 53

ch17 - Data stored in variables and arrays is temporary Its...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online