cmsc 150 introduction to computing cs 150: wed 11 jan 2012
TRANSCRIPT
![Page 1: CMSC 150 INTRODUCTION TO COMPUTING CS 150: Wed 11 Jan 2012](https://reader030.vdocuments.net/reader030/viewer/2022032612/56649ec75503460f94bd2dc0/html5/thumbnails/1.jpg)
CMSC 150INTRODUCTION
TOCOMPUTING
CS 150: Wed 11 Jan 2012
![Page 2: CMSC 150 INTRODUCTION TO COMPUTING CS 150: Wed 11 Jan 2012](https://reader030.vdocuments.net/reader030/viewer/2022032612/56649ec75503460f94bd2dc0/html5/thumbnails/2.jpg)
Quote of the Day
“A smartphone today has more computing power than all of NASA did when it put a man on the moon in 1969.”
- Paul Otellini, Intel CEOQuoted from Michael J. Miller’s ForwardThinking blog
![Page 3: CMSC 150 INTRODUCTION TO COMPUTING CS 150: Wed 11 Jan 2012](https://reader030.vdocuments.net/reader030/viewer/2022032612/56649ec75503460f94bd2dc0/html5/thumbnails/3.jpg)
Homework, due Wednesday 1/18 p. 39 - 40: 2, 3, 7, 9 p. 127 - 129: 4, 6, 7, 8, 10, 11 p. 130: #4 and 5 (can be done on pencil
and paper or as a BlueJ project - use project name hw1_<your_netid> as your project name, and be sure to put your name in the comment at the top of the .java file if you do this in BlueJ)
Bonus problem: p. 128: #6
![Page 4: CMSC 150 INTRODUCTION TO COMPUTING CS 150: Wed 11 Jan 2012](https://reader030.vdocuments.net/reader030/viewer/2022032612/56649ec75503460f94bd2dc0/html5/thumbnails/4.jpg)
Compiling & Executing
Compiler
JavaProgra
m(Source)
JavaProgra
m(Source)
JavaProgram
(Byte Code)
JavaProgram
(Byte Code)
JavaVirtualMachin
e
You write the .java source codeinto a text file using an IDE, e.g., BlueJ
![Page 5: CMSC 150 INTRODUCTION TO COMPUTING CS 150: Wed 11 Jan 2012](https://reader030.vdocuments.net/reader030/viewer/2022032612/56649ec75503460f94bd2dc0/html5/thumbnails/5.jpg)
Compiler
The compiler is a program thatconverts source to binary; Included as part of Java
JavaProgra
m(Source)
JavaProgra
m(Source)
JavaProgram
(Byte Code)
JavaProgram
(Byte Code)
JavaVirtualMachin
e
Compiling & Executing
![Page 6: CMSC 150 INTRODUCTION TO COMPUTING CS 150: Wed 11 Jan 2012](https://reader030.vdocuments.net/reader030/viewer/2022032612/56649ec75503460f94bd2dc0/html5/thumbnails/6.jpg)
Compiler
JavaProgra
m(Source)
JavaProgra
m(Source)
JavaProgram
(Byte Code)
JavaProgram
(Byte Code)
JavaVirtualMachin
e
The .class byte code file (binary) can be executed
Compiling & Executing
![Page 7: CMSC 150 INTRODUCTION TO COMPUTING CS 150: Wed 11 Jan 2012](https://reader030.vdocuments.net/reader030/viewer/2022032612/56649ec75503460f94bd2dc0/html5/thumbnails/7.jpg)
Compiler
JavaProgra
m(Source)
JavaProgra
m(Source)
JavaProgram
(Byte Code)
JavaProgram
(Byte Code)
JavaVirtualMachin
e
Java VM is a program thatexecutes byte code instructions on the CPU
Compiling & Executing
![Page 8: CMSC 150 INTRODUCTION TO COMPUTING CS 150: Wed 11 Jan 2012](https://reader030.vdocuments.net/reader030/viewer/2022032612/56649ec75503460f94bd2dc0/html5/thumbnails/8.jpg)
RAM vs. Hard Drive
![Page 9: CMSC 150 INTRODUCTION TO COMPUTING CS 150: Wed 11 Jan 2012](https://reader030.vdocuments.net/reader030/viewer/2022032612/56649ec75503460f94bd2dc0/html5/thumbnails/9.jpg)
Your Program’s State
Your .java source code file is saved to disk
![Page 10: CMSC 150 INTRODUCTION TO COMPUTING CS 150: Wed 11 Jan 2012](https://reader030.vdocuments.net/reader030/viewer/2022032612/56649ec75503460f94bd2dc0/html5/thumbnails/10.jpg)
Your Program’s State
When you compile, the.class binary file is alsosaved to disk
![Page 11: CMSC 150 INTRODUCTION TO COMPUTING CS 150: Wed 11 Jan 2012](https://reader030.vdocuments.net/reader030/viewer/2022032612/56649ec75503460f94bd2dc0/html5/thumbnails/11.jpg)
Your Program’s State
When you run the program,the Java VM loads thebinary version into RAM…
![Page 12: CMSC 150 INTRODUCTION TO COMPUTING CS 150: Wed 11 Jan 2012](https://reader030.vdocuments.net/reader030/viewer/2022032612/56649ec75503460f94bd2dc0/html5/thumbnails/12.jpg)
Your Program’s State
so that the instructions canbe executed on the CPU
![Page 13: CMSC 150 INTRODUCTION TO COMPUTING CS 150: Wed 11 Jan 2012](https://reader030.vdocuments.net/reader030/viewer/2022032612/56649ec75503460f94bd2dc0/html5/thumbnails/13.jpg)
Let’s Move Into BlueJ…