CIS260 Summer Exam 1 First Name Last Name: 2) is the brain of a computer. 2) A) Memory B) Hardware C) Disk D) CPU

Similar documents
Full file at

Date: Dr. Essam Halim

Computer Programming, I. Laboratory Manual. Final Exam Solution

Introduction to Computers, Programs, and Java. CSE 114, Computer Science 1 Stony Brook University

Supplementary Test 1

Full file at

COMP Computer Basics. Yi Hong May 13, 2015

Full download all chapters instantly please go to Solutions Manual, Test Bank site: testbanklive.com

Chapter 1 Introduction to Computers, Programs, and Java

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

Chapter 1 INTRODUCTION

Chapter 1 Introduction to Computers, Programs, and Java

Programming: detailed instructions which tell the computer hardware what to do aka software Computer Science: the study NOT of computers, but of what

Introduction to Java. Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved.

Programming with Java

Elements of Computers and Programming Dr. William C. Bulko. What is a Computer?

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

4. If the following Java statements are executed, what will be displayed?

Key Differences Between Python and Java

Chapter 1 Introduction to Computers, Programs, and Java

Java Bytecode (binary file)

Chapter 1 Introduction to Computers, Programs, and Java

Gaddis: Starting Out with Java: From Control Structures through Objects, 6/e

Darrell Bethea May 10, MTWRF 9:45-11:15 AM Sitterson 011

Starting Out with Java: From Control Structures through Data Structures 3e (Gaddis and Muganda) Chapter 2 Java Fundamentals

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

Introduction to Java Applications

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

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

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

Objectives. Chapter 1 Introduction to Computers, Programs, and Java. What is a Computer?

Problem Solving With Loops

Pace University. Fundamental Concepts of CS121 1

Chapter 1. Introduction to Computers and Programming. M hiwa ahmad aziz

Lab Determining Data Storage Capacity

Chapter 1 Introduction to Computers, Programs, and Java

THE JAVA FOR STATEMENT

CS110: PROGRAMMING LANGUAGE I

Chapter 1: Introduction to Computers, Programs, and Java

Chapter 1 Introduction to Computers, Programs, and Java

Interpreted vs Compiled. Java Compile. Classes, Objects, and Methods. Hello World 10/6/2016. Python Interpreted. Java Compiled

Chapter 1 Introduction to Computers, Programs, and Java

Chapter 1 Introduction to Computers, Programs, and Java

Lecture 9. Assignment. Logical Operations. Logical Operations - Motivation 2/8/18

Introduction to Computers and Java. Objectives. Outline. Harald Gall, Prof. Dr. Institut für Informatik Universität Zürich.

Introduction to Computers and Java

Getting Started with Java. Atul Prakash

Full file at

Introduction to Computers and Java

Computer Science. ESC 120 Introduction to Engineering Design

Example. Generating random numbers. Write a program which generates 2 random integers and asks the user to answer the math expression.

WOSO Source Code (Java)

Zhifu Pei CSCI5448 Spring 2011 Prof. Kenneth M. Anderson

Introduction to Computers and Java. Objectives. Outline. Harald Gall, Prof. Dr. Institut für Informatik Universität Zürich.

COMP 110 Introduction to Programming. What did we discuss?

Darrell Bethea May 25, 2011

Computer Programming, I. Laboratory Manual. Experiment #6. Loops

Introduction to Java Programming

Peer Instruction 1. Elementary Programming

Lecture Notes. System.out.println( Circle radius: + radius + area: + area); radius radius area area value

Example. Write a program which generates 2 random integers and asks the user to answer the math expression.

Chapter 1 Computer and Programming. By Zerihun Alemayehu

Introduction to Java Applications; Input/Output and Operators

1 class Lecture3 { 2 3 "Selections" // Keywords 8 if, else, else if, switch, case, default. Zheng-Liang Lu Java Programming 88 / 133

CONTENTS: Compilation Data and Expressions COMP 202. More on Chapter 2

Introduction to Software Development (ISD) David Weston and Igor Razgon

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

ANSWERS. Birkbeck (University of London) Software and Programming 1 In-class Test Feb Student Name Student Number. Answer all questions

Understanding main() function Input/Output Streams

Assignment 1 Expressions Data Types Formatted Printing Variables Scanning CSC 123 Fall 2018 Answer Sheet Short Answers

Section 2.2 Your First Program in Java: Printing a Line of Text

C Syntax Out: 15 September, 1995

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

Working with JavaScript

2.8. Decision Making: Equality and Relational Operators

Computational Physics Operating systems

2.5 Another Application: Adding Integers

Logic is the anatomy of thought. John Locke ( ) This sentence is false.

1 class Lecture3 { 2 3 "Selections" // Keywords 8 if, else, else if, switch, case, default. Zheng-Liang Lu Java Programming 89 / 137

Midterm Examination (MTA)

Lecture Set 2: Starting Java

Introduction. Introduction to OOP with Java. Lecture 01: Introduction to OOP with Java - AKF Sep AbuKhleiF -

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

Lecture Set 2: Starting Java

Chapter 1: Why Program? Main Hardware Component Categories 8/23/2014. Main Hardware Component Categories: Why Program?

switch-case Statements

Arithmetic Compound Assignment Operators

Chapter 2: Programming Concepts

CHAPTER 1 Introduction to Computers and Java

Introduction to OOP with Java. Instructor: AbuKhleif, Mohammad Noor Sep 2017

Quiz Start Time: 09:34 PM Time Left 82 sec(s)

CS201 Latest Solved MCQs

IEEE Floating-Point Representation 1

BIL 104E Introduction to Scientific and Engineering Computing. Lecture 1

Array. Array Declaration:

Preview from Notesale.co.uk Page 6 of 52

Introduction to Java

Scanner Objects. Zheng-Liang Lu Java Programming 82 / 133

Lecture 05 I/O statements Printf, Scanf Simple statements, Compound statements

Chapter 1: Introduction to Computers and Programming

Transcription:

CIS260 Summer 2012 - Exam 1 First Name Last Name: MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. 1) is the physical aspect of the computer that can be seen. 1) A) Application program B) Hardware C) Operating system D) Software 2) is the brain of a computer. 2) A) Memory B) Hardware C) Disk D) CPU 3) The speed of the CPU is measured in. (Choose all that apply.) 3) A) gigabytes B) gigahertz C) megahertz D) megabytes 4) One byte has bits. 4) A) 4 B) 8 C) 16 D) 12 5) Computer can execute the code in. 5) A) assembly language B) machine language C) high-level language D) none of the above 6) translates high-level language program into machine language program. A) An assembler B) The operating system C) CPU D) A compiler 6) 7) is an operating system. 7) A) Java B) Ada C) Windows XP D) Visual Basic E) C++ 8) is a program that runs on a computer to manage and control a computer's activities. A) Operating system B) Compiler C) Java D) Modem E) Interpreter 8) 9) is interpreted. 9) A) C B) Pascal C) Ada D) C++ E) Java

10) is Architecture-Neutral. 10) A) Ada B) C++ C) Java D) Pascal E) C 11) provides an integrated development environment (IDE) for rapidly developing Java programs. Editing, compiling, building, debugging, and online help are integrated in one graphical user interface. A) Java language specification B) Java JDK C) Java API D) Java IDE 11) 12) A block is enclosed inside. 12) A) quotes B) parentheses C) brackets D) braces 13) Which of the following statements is correct? 13) A) Every comment line must end with a semicolon. B) Every method must end with a semicolon. C) Every statement in a program must end with a semicolon. D) Every class must end with a semicolon. E) Every line in a program must end with a semicolon. 14) The extension name of a Java source code file is 14) A).exe B).class C).obj D).java 15) Java compiler translates Java source code into. 15) A) assembly code B) Java bytecode C) machine code D) another high-level language code 16) The extension name of a Java bytecode file is 16) A).java B).exe C).class D).obj 17) is a software that interprets Java bytecode. 17) A) Java API B) Java compiler C) Java debugger D) Java virtual machine 18) Suppose a Scanner object is created as follows: 18) Scanner input = new Scanner(System.in); What method do you use to read an int value? A) input.int(); B) input.nextint(); C) input.nextinteger(); D) input.integer();

19) To assign a value 1 to variable x, you write 19) A) 1 := x; B) x == 1; C) x = 1; D) 1 = x; E) x := 1; 20) To declare a constant MAX_LENGTH inside a method with value 99.98, you write A) final float MAX_LENGTH = 99.98; B) final double MAX_LENGTH = 99.98; C) double MAX_LENGTH = 99.98; D) final MAX_LENGTH = 99.98; 20) 21) Which of these data types requires the most amount of memory? 21) A) int B) short C) long D) byte 22) Which of the following expression results in a value 1? 22) A) 25 % 5 B) 2 % 1 C) 37 % 6 D) 15 % 4 23) 25 % 1 is. 23) A) 1 B) 2 C) 3 D) 4 E) 0 24) To declare an int variable number with initial value 2, you write 24) A) int number = 2l; B) int number = 2.0; C) int number = 2; D) int number = 2L; 25) 24 % 5 is. 25) A) 1 B) 2 C) 3 D) 4 E) 0 26) To add number to sum, you write (Note: Java is case-sensitive) (Choose all that apply.) A) sum = sum + number; B) sum = Number + sum; C) number += sum; D) number = sum + number; E) sum += number; 27) What is the printout of the following code: 26) 27) double x = 5.5; int y = (int)x; System.out.println("x is " + x + " and y is " + y); A) x is 6.0 and y is 6.0 B) x is 5 and y is 6 C) x is 6 and y is 6 D) x is 5.5 and y is 5.0 E) x is 5.5 and y is 5 28) What is the value of (double)(5/2)? 28) A) 3 B) 2 C) 3.0 D) 2.5 E) 2.0

29) What is the value of (double)5/2? 29) A) 2.5 B) 2 C) 3 D) 3.0 E) 2.0 30) What is the printout of System.out.println('z' - 'a')? 30) A) 26 B) a C) z D) 25

Java Programming (Tip Calculator) Write a Java program that reads the subtotal and gratuity rate, then computes the tip and total. For example if the user enter 20 and 15, the program displays Tip is $3.00 and Total is $23.00

1) B 2) D 3) B, C 4) B 5) B 6) D 7) C 8) A 9) E 10) C 11) D 12) D 13) C 14) D 15) B 16) C 17) D 18) B 19) C 20) B 21) C 22) C 23) E 24) C 25) D 26) A, E 27) E 28) E 29) A 30) D