220 likes | 357 Views
CIS 260: App Dev I. Chapter 1: Overview. IT and Computer Systems. Important changes in information technology (IT) Newspapers ïƒ WWW Snail mail ïƒ email Typewriter ïƒ _____________ Brick & mortar ïƒ e-commerce Two major components of a computer system: Hardware: run by software
E N D
CIS 260: App Dev I Chapter 1: Overview
IT and Computer Systems • Important changes in information technology (IT) • Newspapers WWW • Snail mail email • Typewriter _____________ • Brick & mortar e-commerce • Two major components of a computer system: • Hardware: run by software • Software: created/used by people
History of Computers • See http://sunsethigh.dade.k12.fl.us/sunset/history/index.htm for a good history. • A brief history: • 1950s: emergence of mainframes • 1960s: widespread use of mainframes • 1970s: widespread use of minicomputers • 1980s: ____ become popular • 1990s: notebooks, Internet become popular • 2000s: E-commerce, wireless become popular
Tasks Performed by Computers • Input • Human (e.g., keypunch, mouse) • Automated (e.g., barcode, RFID) • Output • Human readable • Non-human readable • Storage • Primary • Secondary • Operations • Arithmetic • ____________
Hardware • CPU • Control unit, arithmetic logic unit, instruction register, program counter • Main memory • Memory cells with addresses • RAM, ROM • Holds programs and data • Volatile • __________ storage • Hard disk, floppy disk, CD-ROM, flash drive • I/O • Input: keyboard, mouse, screen, scanner • Output: printer, monitor, speaker
Software • System programs • Operating system • Windows Explorer • Control Panel • Application programs • Word processor • Spreadsheet • Internet browser • ERP (__________ resource planning) • Games
Computer Languages • Signals • Analog: changes are continuous (audio tape) • _______: changes are discrete, on/off (music CD) • Computer codes • Binary digit (bit): a 0 or 1 (off/on), base 2 • Byte: 8 _____ (00000001, 00000010, …) • ASCII code: 128 characters (27), nearly a byte • EBCDIC: 256 characters (28), one byte • Unicode: 65,536 characters (216), two bytes
Programming Languages • Machine languages • instructions in codes with 0s and 1s • Depends on type of CPU • Codes used for memory locations, operations • Assembly languages • ___________ used for instructions • 100100 means LOAD, 100101 means ADD • Assembler translates AL to ML • High-level languages (C, C++, Java) • Compiler converts Java to bytecode • ________ (JVM) converts bytecode to ML
Processing a Java Program • Programmer creates ______ code in an editor • Type the Java code as a text file • Save the text file as <ClassName>.java • Compile the source code into __________ • Source code MUST follow Java syntax • Compiler creates the bytecode in <ClassName>.class • Link the bytecode to other programs • The Java library contains additional programs • A linker links your bytecode to create executable code • Run the executable program • Loader loads executable into main memory • __________ translates executable code into ML
Programming Process • Java Integrated Development Environments (IDE’s) • Forte • JBuilder • NetBeans • BlueJ • Programming Aids • Flowcharts: graphic • ____________: textual, non-executable
Programming Methodologies • Structured programming • Divide a problem into procedures • Use basic programming structures • Sequence: do A, do B, do C, … • Selection: if…then • Loop: automated repetition • ________-oriented programming (OOP) • Represent a problem as interacting objects • Determine the objects’ attributes • Determine the objects’ behaviors
Introduction to Java • Java was created in 1996 by _______. • JDK is the Java _________, where “JDK” stands for __________ Development Kit. • Java syntax is similar to that of _______. • Java was designed to run on any computer _________ (i.e., combination of operating system and microprocessor). • Java applications run slightly _______ than most others. • Java handles internal memory overhead ______________.
Applications, Applets, & Servlets • Java can be used to create ____________ that often have a GUI (_________ user interface). • Java can be used to create web-based applications called __________. • A Java server-side application is called a __________. • You can copy the applications from the text CD by running the OO_Java_Source_Code.zip file.
How Java Compiles & Interprets • You can use a text ________ to create Java ________ code (.java file extension). • The Java __________ converts the source code into Java _________. • A platform that has a Java __________ (a.k.a. a Java _______ machine or JVM) can translate the bytecodes into the processor’s (machine) language. • A web browser with a Java interpreter can download and run Java ________.
Installing the JDK • Using the CD that comes with the text, • Simply navigate to the Java folder (in the Software folder), double-click the .exe file. • Follow the prompts. • Using the www.java.sun.com web site, • Select the download link for Java SE (Standard Edition). • Download (can take a long time and can contain errors). • Run the .exe file and follow the prompts.
Directories & Files of the SDK • In the c:\jdk1.6.x directory, • bin contains the Java _________ and other necessary tools for developing and testing • demo contains sample applications and ________ • include contains header files for using ____ code in Java applications • jre contains the Java __________ or Java Runtime Environment • lib contains libraries and support files • doc contains _____________
Select Start, Settings, ControlPanel. Select System, Advanced tab, and EnvironmentVariables button). Select Path under Systemvariables, Edit… At the end of the current path, enter a “;” and add c:\jk1.6.x\bin\ (replace x with the current #) If the system has a classpath variable, add “;.;” at the end. To Configure Windows
Creating a Java Program • Run Notepad (Start, Programs, Accessories, Notepad). • Enter Java code (exactly), such as public class MyFirstJavaProgram { public static void main( String[ ] args ) { System.out.println(“Hello world!”); } } • Remember!!! Java is ______-sensitive. • Save the file as “MyFirstJavaProgram.java”, say, in a folder called “first” on the a:\ drive (use the quotes on the file name).
Compiling and Running • Run the Command Prompt (Start, Programs, Accessories, CommandPrompt). • To ________, at the C:\> prompt, enter the following: a: javac \first\MyFirstJavaProgram.java • To _____, at the A:\> prompt, enter the following: cd\first java MyFirstJavaProgram
Errors • You may get compile-time errors or run-time errors. • The JDK will provide the line _______ of the error, a description, and the actual code that is in error. • You will need to go back to _________ to correct the errors, recompile, and rerun.
Creating a Java File w/ TextPad • TextPad is a text _______ designed for Java. • To install TextPad go to http://www.textpad.com/download/index.html#downloads and select English, FTP (USA) • To run TextPad… • click Start, Programs, TextPad • To create a Java program… • enter Java code • select File, Save As… • enter the file name (matches the class name) • select Java as file type, OK.
To Compile and Run w/ TextPad • To compile… • Select Tools, Compile Java (or Ctrl+1) • To run… • Select Tools, Run Java Application (or Ctrl+2) • To view line numbers of code… • Select Configure, Preferences, View • What’s wrong with using a complex IDE (___________ Development Environment) in an introductory course? • Interferes with learning how to write pure Java code • Wastes precious time learning the IDE