· Computer science is studying foundational techniques used to solve real world problems using computers
· Computer science is an applied discipline, i.e., you apply these techniques to new problems to create new solutions for these problems
· Programming is the way you instruct a computer to execute the solutions you have created
Instructions tell the computer to do something.
Data is the something that has something done to it.
Here is an instruction: 3 + 4
The 3 and the 4 are both data. The instruction tells the computer to add these two pieces of data.
The portion of the circuitry that reads and executes
instructions
Both instructions and data are stored in memory.
Memory is a large collection of bits in a computing device.
A bit is typically implemented by a transistor.
A transistor is basically a capacitor.
A capacitor has the ability to hold an electric charge.
A capacitor can be on (it is holding a charge) or off (it is not holding a charge).
We consider a capacitor that is on to be a 1, and a capacitor that is off to be a 0.
Thus memory is simply a very long string of 1’s and 0’s.
Both instructions and data are held in memory.
How do we know whether any given set of bits is an instruction or a piece of data?
At any given time, memory contains a specific pattern of 1’s and 0’s. We call the specific pattern of 1’s and 0’s that appear at a particular time a memory image.
Permanent storage is some device that can maintain the value of the bits it is storing without being connected to a power source. The most common permanent storage device used to be the hard-disk in personal computers and servers, but it may have been surpassed in number of raw devices by flash memory devices by now….
We generally call a logical piece of permanent storage a file.
A program to sequentially draw graphical shapes on the screen.
Make a directory (folder) named cs256 on your P: drive.
Right-click this link: ../demos/SequentialShapes.java and save to P:\cs256\SequentialShapes.java
File | Open
Browse to P:\cs256\SequentialShapes.java
Next, click the
compile button
Notice the messages from the compiler in the Run I/O window at the bottom of the screen.
Notice a window appears with a circle inside a square.
See if you can determine why the image appears as it does by reading the java code.
Try changing the order of the java statements and see how it changes the image.