Full file at

Similar documents
Chapter 2 First Java Programs

Lesson 2: First Java Programs

1. Java is the fastest growing programming language in the world.

Introduction to JAVA Programming Language

Full file at Chapter 2: An Introduction to SQL

Excel Tutorial 1: Getting Started with Excel

Introduction to OOP Using Java Pearson Education, Inc. All rights reserved.

3. Except for strings, double quotes, identifiers, and keywords, C++ ignores all white space.

Course Outline. Introduction to java

Chapter 2 Author Notes

CITS2401 Computer Analysis & Visualisation

Starting with a great calculator... Variables. Comments. Topic 5: Introduction to Programming in Matlab CSSE, UWA

Chapter 1. Introduction

Computer Software A computer contains two major sets of tools, software and hardware. Software is generally divided into Systems software and

Chapter 1 INTRODUCTION

C++ Spring Break Packet 11 The Java Programming Language

Learning objectives. The Java Environment. Java timeline (cont d) Java timeline. Understand the basic features of Java

Full file at Excel Chapter 2 - Formulas, Functions, Formatting, and Web Queries

Programming. Syntax and Semantics

From High Level to Machine Code. Compilation Overview. Computer Programs

PROGRAMMING FUNDAMENTALS

2.8. Decision Making: Equality and Relational Operators

Chapter 3 Syntax, Errors, and Debugging. Fundamentals of Java

12/22/11. Java How to Program, 9/e. Help you get started with Eclipse and NetBeans integrated development environments.

History Introduction to Java Characteristics of Java Data types

Introduction to Java Programming

Chapter 4 Creating Tables in a Web Site Using an External Style Sheet

Full file at C How to Program, 6/e Multiple Choice Test Bank

COSC 123 Computer Creativity. Introduction to Java. Dr. Ramon Lawrence University of British Columbia Okanagan

An Introduction to Software Engineering. David Greenstein Monta Vista High School

2 rd class Department of Programming. OOP with Java Programming

Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson

USING THE OOSIML/JAVA COMPILER. With the Command Window

Università degli Studi di Bologna Facoltà di Ingegneria. Principles, Models, and Applications for Distributed Systems M

Introduction to Visual Basic and Visual C++ Introduction to Java. JDK Editions. Overview. Lesson 13. Overview

Outline. Introduction to Java. What Is Java? History. Java 2 Platform. Java 2 Platform Standard Edition. Introduction Java 2 Platform

Full file at DW Chapter 2: Developing a Web Page

2 Introduction to Java. Introduction to Programming 1 1

c) Comments do not cause any machine language object code to be generated. d) Lengthy comments can cause poor execution-time performance.

Introduction to Java. Lecture 1 COP 3252 Summer May 16, 2017

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

Introduction to C# Applications

Matlab Programming MET 164 1/24

CSI Lab 02. Tuesday, January 21st

Chapter 1 Introduction to HTML, XHTML, and CSS

CHAPTER 1. Introduction to JAVA Programming

Chapter 1 & 2 Introduction to C Language

Core Java Syllabus. Pre-requisite / Target Audience: C language skills (Good to Have)

SECTION 1: INTRODUCTION. ENGR 112 Introduction to Engineering Computing

Java Overview An introduction to the Java Programming Language

Access Test Chapters 1 and 2

Which statement regarding computer programs is correct? Which statement best describes a computer program?

Chapter 1 Introduction to Computers, Programs, and Java. What is a Computer? A Bit of History

Slide 1 Java Programming 1 Lecture 2D Java Mechanics Duration: 00:01:06 Advance mode: Auto

Using Java for Scientific Computing. Mark Bul EPCC, University of Edinburgh

Objectives. Problem Solving. Introduction. An overview of object-oriented concepts. Programming and programming languages An introduction to Java

Chapter 1: Introduction to Computers and Java

8/23/2014. Chapter Topics. Introduction. Java History. Why Program? Java Applications and Applets. Chapter 1: Introduction to Computers and Java

Arithmetic Operators. Binary Arithmetic Operators. Arithmetic Operators. A Closer Look at the / Operator. A Closer Look at the % Operator

Lesson 1A - First Java Program HELLO WORLD With DEBUGGING examples. By John B. Owen All rights reserved 2011, revised 2015

Working with JavaScript

CPS122 Lecture: From Python to Java last revised January 4, Objectives:

Full file at

SKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG)

Terminology & Basic Concepts

Connecting with Computer Science, 2e. Chapter 15 Programming II

Chapter 1 INTRODUCTION SYS-ED/ COMPUTER EDUCATION TECHNIQUES, INC.

Computer Organization and Assembly Language. Lab Session 01

T H E I N T E R A C T I V E S H E L L

Simple Java Programming Constructs 4

Chapter. Focus of the Course. Object-Oriented Software Development. program design, implementation, and testing

Excel Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts. 6. You can use a table s sizing handle to add columns or rows to a table.

Hypertext Markup Language, or HTML, is a markup

Chapter 2: Working with the Windows 7 Desktop

Expressions and Data Types CSC 121 Fall 2015 Howard Rosenthal

Module 1: Introduction to Computers, Programs, and Java

Chapter 1. Introduction to Computers and Java Objects. Background information. » important regardless of programming language. Introduction to Java

Tutorial 1 CSC 201. Java Programming Concepts عؾادئماظربجمةمبادؿكدامماجلاصا

Class List. Java Must Have. Class Goals. Class Goals. Schedule

UNIT - I. Introduction to C Programming. BY A. Vijay Bharath

Introduction to Java

Programming with Java

ch02 True/False Indicate whether the statement is true or false.

Creating a C++ Program

Chapter 2: Using Data

Identifiers. Identifiers are the words a programmer uses in a program Some identifiers are already defined. Some are made up by the programmer:

EGR 111 Introduction to MATLAB

Introduction to Java Applications; Input/Output and Operators

Goals. Java - An Introduction. Java is Compiled and Interpreted. Architecture Neutral & Portable. Compiled Languages. Introduction to Java

Computer Programming : C++

What is a programming language?

Chapter 1 Introduction to Java

4. Structure of a C++ program

Java Language. Programs. Computer programs, known as software, are instructions to the computer. You tell a computer what to do through programs.

CHAPTER INTRODUCTION

CS506 Web Programming and Development Solved Subjective Questions With Reference For Final Term Lecture No 1

Chapter 4 Introduction to Control Statements

COBOL-IT Developer Studio

B.V. Patel Institute of BMC & IT, UTU 2014

Chapter 2: Solving Problems with Statistical Analysis Tools

Transcription:

Ch02 True/False Indicate whether the statement is true or false. 1. Java bears a superficial resemblance to C++. 2. Java is ideally suited to developing distributed, network-based applications. 3. Java applets have little risk of infecting your computer with a virus. 4. Source code is the bulk of the instructions of a program. 5. UNIX is available on any Macintosh computer that runs MacOS X. 6. A DOS development environment combines an editor, Java compiler, debugger, and a JVM. 7. The main factor affecting a program s readability is misspelled words. 8. In Java, as in algebra, addition and subtraction have a higher precedence than multiplication and division. 9. Graphics and GUI programs in Java can run either as stand-alone applications or as applets. 10. Java programs accomplish many tasks by sending messages to objects. Modified True/False Indicate whether the statement is true or false. If false, change the identified word or phrase to make the statement true. 11. GUI is the machine language for an imaginary Java computer. 12. The main advantage of a compiler is that any computer can run it. 13. The terminal I/O user interface is familiar to all PC users. 14. Syntax errors is another term for compile-time errors. 15. Parameters are used to share information between objects. Multiple Choice Identify the choice that best completes the statement or answers the question. 16. Which of the following is NOT true about Java? a. Java is an object-based language. b. Java creates programs that are portable. c. The Java compiler translates into machine language. d. Java supports threads.

17. Java is all of the following EXCEPT. a. fast c. robust b. secure d. portable 18. A(n) is a process that can run concurrently with other processes. a. applet c. interpreter b. thread d. parameter 19. To run Java byte code, you must install a(n). a. GUI c. IDE b. JIT d. JVM 20. A(n) is a program that behaves like a computer. a. interpreter c. terminal I/O b. compiler d. applet 21. Some JVMs translate byte code instructions into machine language when they are first encountered, using the technique. a. IDE c. variable b. JIT d. interpreter 22. A(n) is a small Java program that runs on Web pages. a. JIT c. JVM b. parameter d. applet 23. All of the following are benefits of using a terminal I/O interface EXCEPT. a. In Java, it is easier to implement than GUI. b. It is more common and familiar. c. Some programming situations require a terminal I/O interface. d. Terminal-oriented programs are similar to programs that process files of sequentially organized data. 24. A is used to mark the end of each statement in a program. a. comma (,) c. period (.) b. slash (/) d. semicolon (;) 25. The string of characters that appears between the parentheses following the message in Java code is called a(n). a. parameter c. variable b. statement d. thread 26. The three steps to writing and running a program, in order, are. a. enter, edit, compile c. edit, compile, execute b. edit, execute, compile d. enter, interpret, compile 27. is an editor available with Microsoft Windows. a. Linux c. BlueJ b. UNIX d. Notepad 28. All of the following are examples of integrated development environments, EXCEPT. a. BlueJ c. JFrame b. Eclipse d. JGrasp 29. The main factor affecting a program s readability is its.

a. layout c. language b. spelling d. development environment 30. SomeClass someobject = new SomeClass (some parameters); is an example of. a. assignment c. byte code b. instantiation d. interpretation 31. is an assignment operator. a. + c. = b. * d. All of the above. 32. A(n) has a container or pane that can be filled with other objects. a. JFrame c. window b. panel d. IDE 33. Colors in most computer systems use the scheme. a. color class c. CMYK b. RGB d. GUI FIGURE 2-1 34. Figure 2-1 above represents a(n) user interface. a. GUI c. terminal I/O b. JVM d. variable FIGURE 2-2 35. Figure 2-2 above represents a(n) user interface. a. GUI c. terminal I/O b. JVM d. variable Case 2-1 Jeremiah is a C++ programmer who has been asked by a client to create a program using Java. 36. Jeremiah knows that Java is. a. better suited to the Internet than C++ b. more error-prone than C++ c. the world s most popular industrial-strength programming language

d. superficially very different from C++ 37. Jeremiah will incorporate into his Java program in order to allow multiple processes to occur at once, such as an image being transferred from one machine to another across a network, while another process simultaneously interacts with the user. a. variables c. panels b. threads d. applets Case 2-2 Lucia is editing a program using Java. She has to install a development environment on her computer before she can get started. 38. Lucia considers using the development environment, which has the most widespread use. a. JGrasp c. DOS b. Notepad d. UNIX 39. Lucia decides to use the development environment so that she can increase her productivity. a. JGrasp c. DOS b. Notepad d. UNIX Completion Complete each statement. 40. is the fastest growing programming language in the world. 41. A comical animated character on a Web page is likely run using a program called a(n). 42. A(n) is a programmer who breaks into computer systems in an unauthorized way. 43. In the layout, the default layout manager for frames, you can arrange up to five objects. 44. In the layout, objects are arranged in rows and columns. Matching Identify the letter of the choice that best matches the phrase or definition. a. Applet b. GUI c. IDE d. Pane e. Byte code 45. An example could be a continuous stream of stock quotes. 46. Windows are often organized into many of these. 47. To run this, you must install a JVM on the computer.

48. Eclipse is an example. 49. Familiar interface for PC users. Essay 50. List at least three reasons why Java is used by companies such as Sun and IBM to develop their major applications. Why might a programmer choose another language?

Ch02 Answer Section TRUE/FALSE 1. ANS: T PTS: 1 REF: 32 2. ANS: T PTS: 1 REF: 32 3. ANS: T PTS: 1 REF: 33 4. ANS: T PTS: 1 REF: 35 5. ANS: T PTS: 1 REF: 38 6. ANS: F PTS: 1 REF: 38 7. ANS: F PTS: 1 REF: 40 41 8. ANS: F PTS: 1 REF: 44 9. ANS: T PTS: 1 REF: 46 10. ANS: T PTS: 1 REF: 52 MODIFIED TRUE/FALSE 11. ANS: F, Byte code PTS: 1 REF: 32 12. ANS: F, interpreter PTS: 1 REF: 33 13. ANS: F GUI graphical PTS: 1 REF: 33 14. ANS: T PTS: 1 REF: 40 15. ANS: T PTS: 1 REF: 43 MULTIPLE CHOICE 16. ANS: C PTS: 1 REF: 32 17. ANS: A PTS: 1 REF: 32 18. ANS: B PTS: 1 REF: 32 19. ANS: D PTS: 1 REF: 32 20. ANS: A PTS: 1 REF: 32 21. ANS: B PTS: 1 REF: 32 33 22. ANS: D PTS: 1 REF: 33 23. ANS: B PTS: 1 REF: 34 24. ANS: D PTS: 1 REF: 35 25. ANS: A PTS: 1 REF: 35 26. ANS: C PTS: 1 REF: 37

27. ANS: D PTS: 1 REF: 38 28. ANS: C PTS: 1 REF: 38 29. ANS: A PTS: 1 REF: 41 30. ANS: B PTS: 1 REF: 43 31. ANS: C PTS: 1 REF: 44 32. ANS: A PTS: 1 REF: 48 33. ANS: B PTS: 1 REF: 48 34. ANS: A PTS: 1 REF: 33 35. ANS: C PTS: 1 REF: 33 36. ANS: A PTS: 1 REF: 32 TOP: Critical Thinking 37. ANS: B PTS: 1 REF: 32 TOP: Critical Thinking 38. ANS: C PTS: 1 REF: 38 TOP: Critical Thinking 39. ANS: A PTS: 1 REF: 38 TOP: Critical Thinking COMPLETION 40. ANS: Java PTS: 1 REF: 31 41. ANS: applet PTS: 1 REF: 33 42. ANS: hacker hack PTS: 1 REF: 41 43. ANS: border PTS: 1 REF: 49 44. ANS: grid PTS: 1 REF: 51 MATCHING 45. ANS: A PTS: 1 REF: 33 46. ANS: D PTS: 1 REF: 48 47. ANS: E PTS: 1 REF: 32 48. ANS: C PTS: 1 REF: 38 49. ANS: B PTS: 1 REF: 33 ESSAY 50. ANS: Four possible reasons to use Java are:

1. It is a modern object-oriented programming language that uses the best features of languages such as C++ and Smalltalk. 2. Java is secure (tamper- and virus-free), robust (programs do not overwrite memory), and portable (programs can be run on different computer types). 3. Java uses advanced programming concepts, such as threads. 4. Java resembles C++, making it easy for C++ programmers to learn Java and vice versa. Why a programmer might choose another lanugage: Java runs more slowly than other modern programming languages because it must be interpreted using a JVM. PTS: 1 REF: 32 TOP: Critical Thinking