





























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
The goals, guidelines, and student responsibilities for the first week of the mat2170 course focused on algorithm design and object oriented paradigm using java. Topics include java basics, the mathcs lab, and the compilation process.
Typology: Lab Reports
1 / 37
This page cannot be seen from the preview
Don't miss anything!
Nancy Van Cleave
Fall 2007
I (^) Algorithm Design
I (^) Object Oriented Paradigm
I (^) Syntax of Java language
I (^) Critical Thinking Skills
I (^) Reading : Textbook, Chapters 1 and 2.
I (^) Lab : Lab 1, Prelab, & Postlab
I (^) Homework : Hwk 1
I (^) Attendance
I (^) What is Computer Science?
I (^) Computer Hardware
I (^) Algorithms
I (^) The Programming Process
I (^) Java
I (^) The mathcs lab
CPU
memory
secondary storage I/O devices
network
bus
............... ................. ............... ................. ............... ................. ............... ................. ............... ................. ............... ................. ............... ................. ................ ............... ................. ............... ................. ................ ................
I (^) CPU ( Central Processing Unit ) - an integrated circuit on a silicon chip; computations, coordinates computer activities
I (^) Memory ( Primary Storage ) - usually a special integrated-circuit chip called a RAM , or random-access memory; information lost when machine turned off
I (^) Secondary Storage - hard disk, thumb drive, CDs, diskettes, etc.; permanent data storage
I (^) Input/Output Devices ( I/O devices ) - keyboard, mouse, monitor, printer
I (^) Network - connection to other computers, Internet
I (^) Algorithmic Design I (^) Specications ñ required I/O, types, restrictions
I (^) Test Suite ñ well-selected inputs with expected outputs I (^) Logic which solves problem (human readable) I (^) General (Outline) I (^) Detailed
I (^) Coding I (^) Translating Detailed algorithm into computer language (JAVA) I (^) Debugging ñ locating and eliminating errors
I (^) Maintenance ñ evolution of program over time
Translating code into machine language
#include <stdio.h> main() {printf("Hello\n"); } compiler
(^01001001010110010001000010100011101011) 0110100111010101100
(^10010110101100010110100100101001011011) 0101101011010100101
(^01001001010110010001000010100011101011) (^01101001110101011001001011010110001011) (^01001001010010110110101101011010100101)
source file object file
linker
executable file
files/librariesother object
Translating code into a machineñindependent intermediate language
I (^) An interpreter for any given machine architecture translates source code into an intermediate language on that machine.
I (^) The interpreter simulates instructions by performing operations that have the same effect.
I (^) No separate executable le is produced ó the interpreter translates and executes at the same time.
Java combines the functions of a compiler and an interpreter
I (^) Initial compilation phase : translates program into a common intermediate language, independent of underlying hardware.
I (^) The intermediate code is stored in les called: class les.
I (^) Class les are combined with other class les and libraries to produce a complete version of the intermediate program with everything it needs linked together.
I (^) Usual format for the resulting program is a compressed collection of individual les called a JAR archive.
compilerJava
Machine^ VirtualJava
CA FE BA BE 00 03 0000 16 07 00 1A 07 00 00 04 00 07 0C 00 1301 00 16 28 4C 6A 6147 72 61 70 68 69 63 CA^000001 FE BA16 0704 0000 16^ BE^000728 00 1A0C4C^030700 6A^00001361 47 72 61 70 68 69 63
import acm.program.*;
}
public class Add2 ext
}
int n1 = readInt("Entprintln("This progr
public void run() { int n2 = readInt("Entint total = n1 + n2; println("The total is
2D 1400 00 1F0A 0018 0C 080200 000017 0F 0800 07 0A1C
class file
files/libraries
Java source file
other class
linker
JAR archive
14 0A 00 02 00 08 0A2D 00 1F 08 00 0F 0700 18 0C 00 17 00 1C
created by mkdir
created by netbeans
HelloProgram
dist
HelloProgram.class
classes
build src
HelloProgram.java
lab
HelloProgram.jar
acmLibrary
nkvancleave
HelloProgram.html HelloProgram.jar acmLibrary.jar
http
index.html
nkvancleave