• /  73
  • 下載費用: 9.90積分  

Java語言程序設計與數據結構 基礎篇原書第11版PPT及其他教輔資源01slide.ppt

'Java語言程序設計與數據結構 基礎篇原書第11版PPT及其他教輔資源01slide.ppt'
*Chapter 1 Introduction to Computers, Programs, and Java*ObjectivesTo understand computer basics, programs, and operating systems (§§1.2–1.4).To describe the relationship between Java and the World Wide Web (§1.5).To understand the meaning of Java language specification, API, JDK, and IDE (§1.6).To write a simple Java program (§1.7).To display output on the console (§1.7).To explain the basic syntax of a Java program (§1.7).To create, compile, and run Java programs (§1.8).To use sound Java programming style and document programs properly (§1.9).To explain the differences between syntax errors, runtime errors, and logic errors (§1.10).To develop Java programs using NetBeans (§1.11).To develop Java programs using Eclipse (§1.12).*What is a Computer?A computer consists of a CPU, memory, hard disk, floppy disk, monitor, printer, and communication devices.*CPUThe central processing unit (CPU) is the brain of a computer. It retrieves instructions from memory and executes them. The unit of measurement of clock speed is the hertz (Hz), with 1 hertz equaling 1 pulse per second. In the 1990s, computers measured clock speed in megahertz (MHz), but CPU speed has been improving continuously; the clock speed of a computer is now usually stated in gigahertz (GHz). Intel’s newest processors run at about 3 GHz.*MemoryMemory is to store data and program instructions for CPU to execute. A memory unit is an ordered sequence of bytes, each holds eight bits. A program and its data must be brought to memory before they can be executed. A memory byte is never empty, but its initial content may be meaningless to your program. The current content of a memory byte is lost whenever new information is placed in it.*How Data is Stored?Data of various kinds, such as numbers, characters, and strings, are encoded as a series of bits (zeros and ones). Computers use zeros and ones because digital devices have two stable states, which are referred to as zero and one by convention. The programmers need not to be concerned about the encoding and decoding of data, which is performed automatically by the system based on the encoding scheme. The encoding scheme varies. For example, character ‘J’ is represented by 01001010 in one byte. A small number such as three can be stored in a single byte. If computer needs to store a large number that cannot fit into a single byte, it uses a number of adjacent bytes. No two data can share or split a same byte. A byte is the minimum storage unit.*Storage DevicesMemory is volatile, because information is lost when the power is off. Programs and data are permanently stored on storage devices and are moved to memory when the computer actually uses them. There are three main types of storage devices: Disk drives (hard disks), CD drives (CD-R and CD-RW), and USB flash drives.*Output Devices: MonitorThe monitor displays information (text and graphics). The resolution and dot pitch determine the quality of the display. *Monitor Resolution and D。省略部分。s with a semicolon (;).*// This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); }}Reserved wordsReserved words or keywords are words that have a specific meaning to the compiler and cannot be used for other purposes in the program. For example, when the compiler sees the word class, it understands that the word after class is the name for the class. *BlocksA pair of braces in a program forms a block that groups components of a program. *Special Symbols*// This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); }}{ … }*// This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); }}( … )*// This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); }};*// This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); }}// …*// This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); }}" … "*Programming Style and DocumentationAppropriate CommentsNaming ConventionsProper Indentation and Spacing LinesBlock Styles*Appropriate CommentsInclude a summary at the beginning of the program to explain what the program does, its key features, its supporting data structures, and any unique techniques it uses. Include your name, class section, instructor, date, and a brief description at the beginning of the program. *Naming ConventionsChoose meaningful and descriptive names.Class names: Capitalize the first letter of each word in the name. For example, the class name ComputeExpression.*Proper Indentation and SpacingIndentationIndent two spaces.Spacing Use blank line to separate segments of the code.*Block StylesUse end-of-line style for braces. *Programming ErrorsSyntax ErrorsDetected by the compilerRuntime ErrorsCauses the program to abortLogic ErrorsProduces incorrect result*Syntax Errorspublic class ShowSyntaxErrors { public static main(String[] args) { System.out.println("Welcome to Java); }}RunShowSyntaxErrors*Runtime Errorspublic class ShowRuntimeErrors { public static void main(String[] args) { System.out.println(1 / 0); }}RunShowRuntimeErrors*Logic Errorspublic class ShowLogicErrors { public static void main(String[] args) { System.out.println("Celsius 35 is Fahrenheit degree "); System.out.println((9 / 5) * 35 + 32); }}RunShowLogicErrors*Compiling and Running Java from NetBeansSee Supplement I.D on the Website for detailsCompanion Website*Compiling and Running Java from EclipseSee Supplement II.D on the Website for detailsCompanion Website
關 鍵 詞:
基礎 ppt 11 及其他 結構 數據 資源 程序設計 01slide 01
 天天文庫所有資源均是用戶自行上傳分享,僅供網友學習交流,未經上傳用戶書面授權,請勿作他用。
關于本文
本文標題:Java語言程序設計與數據結構 基礎篇原書第11版PPT及其他教輔資源01slide.ppt
鏈接地址: http://www.476824.live/p-51617554.html
關于我們 - 網站聲明 - 網站地圖 - 資源地圖 - 友情鏈接 - 網站客服點擊這里,給天天文庫發消息,QQ:1290478887 - 聯系我們

本站為“文檔C2C交易模式”,即用戶上傳的文檔直接賣給(下載)用戶,本站只是中間服務平臺,本站所有文檔下載所得的收益歸上傳人(含作者)所有【成交的100%(原創)】。本站是網絡服務平臺方,若您的權利被侵害,侵權客服QQ:1290478887 歡迎舉報。

[email protected] 2017-2027 http://www.476824.live 網站版權所有

粵ICP備19057495號 

收起
展開
球探网即时蓝球比分 股票分析软件有用吗 计划软件 青海十一选五号码走势图 云南11选五怎么选容易中 多乐彩怎么玩 证券作业分析一只股票 安徽快三中奖规则和奖金 广东快乐十分出号规律 刚工作的人如何理财 首页 吉林快三计划全能版