Introduction To Programming Computer programs mostly deal with data, electronic data. In this section, we're going to look at what data is and how we store it and manipulate it.
Computer programs do three basic things from our perspective.
Let's first look inside the computer at RAM. RAM stands for Random Access Memory. This means that the computer can go get something in RAM from anywhere very quickly. RAM is where the computer stores its data, including the operating system and the programs themselves. How do we imagine RAM? Here's one way:
RAM is one long linear chain of bits. And a bit is a very simple thing, it's just a 0 or a 1. Think of each mark on the tape measure as a single bit. Data is just a collection of bits in a known spot. Say, starting at 5" on the tape measure and going for 10 marks.
Computer programs have to have a way to find and use the data that it needs. They do this with variables. A Variable is a spot in RAM that has been given a name. You can think of variables as a container. But, this container doesn't hold water, it holds bits.
var. This tells JavaScript that you are about to create a named variable. It is required by JavaScript in order to correctly make a variable.count.;).
" = 1" (a space, an equal sign, and the number 1).We need input!
prompt dialog box.
prompt("...") it will open a dialog box. prompt.prompt().We want to start doing some labs. But, we need to be able to see what is going on in our programs.
document refers to the HTML page that contains this JavaScript program..), called the dot, is a way to access things inside of your document. write is a function inside the document. Don't worry if this doesn't make complete sense yet, it will in time.document.write()How a computer keeps its data straight.