100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Test Bank For JAVA FOUNDATIONS 3rd Ed By JOHN LEWIS $33.58   Add to cart

Exam (elaborations)

Test Bank For JAVA FOUNDATIONS 3rd Ed By JOHN LEWIS

 4 views  0 purchase
  • Course
  • Institution

Chapter 3: Using Classes and Objects Multiple Choice Questions: 1) The ________________ operator is used to instantiate an object. a) static b) new c) + d) - e) none of the above Answer: b Explanation: The new operator instantiates an object. There is no static...

[Show more]

Preview 4 out of 156  pages

  • September 26, 2023
  • 156
  • 2022/2023
  • Exam (elaborations)
  • Questions & answers
avatar-seller
,Java Foundations: Introduction to Program Design & Data Structures, 3e
John Lewis, Peter J. DePasquale, Joseph Chase
Test Bank: Chapter 1

Chapter 1: Introduction

Multiple Choice Questions:

1) _____________ consists of specific words and symbols to express a problem solution.

a) A programming language
b) Software
c) Hardware
d) A computer
e) An application

Answer: a
Explanation: A programming language consists of words and symbols to express a problem solution. Software
consists of programs and the data these programs use. Hardware is the tangible parts of a computer, such as keyboards and
hard disks. A computer is made up of hardware and software, and an application is a program that runs on a computer.

2) Java is _____________________.

a) a procedural language
b) a functional language
c) an object-oriented language
d) a fourth-generation language
e) a spoken-language

Answer: c
Explanation: Java is best described as an object-oriented language. Procedural languages, functional languages and
fourth-generation languages are different types of languages that don't necessarily include object-oriented features. A
spoken language is a language such as English or Spanish, and is too ambiguous for a computer to use.

3) In Java, an identifier that is made up by the programmer can consist of ___________________.

a) any characters
b) only numbers
c) only letters
d) only letters, the underscore ( _ ), and the dollar sign ( $ )
e) numbers, letters, the underscore ( _ ), and the dollar sign ( $ )

Answer: e
Explanation: In Java, an identifier can consist of numbers, letters, the underscore and the dollar sign, but it cannot
begin with a number.




1
Pearson © 2014

,Java Foundations: Introduction to Program Design & Data Structures, 3e
John Lewis, Peter J. DePasquale, Joseph Chase
Test Bank: Chapter 1

4) In order for a program to run on a computer, it must be expressed in ______________________.

a) an assembly language
b) a machine language
c) a high-level language
d) an object-oriented language
e) a fourth generation language

Answer: b
Explanation: A computer can only understand its machine language. Assembly languages, high-level languages,
object-oriented languages and fourth generation languages are are languages that are easy for humans to understand, but
they must first be translated into a machine language before they are run on a computer.

5) A syntax error is a _____________________.

a) a logical error
b) a compile-time error
c) a run-time error
d) a bug
e) an exception

Answer: b
Explanation: A program that contains a syntax error is invalid, and therefore cannot be compiled. It is a compile-
time error because it is caught by the compiler. A logical error is an error that causes a running program to behave in an
unexpected manner during run-time. A bug is an example of a logical error. A run-time error is an error that happens while
the program is running. In Java, run-time errors are called exceptions.

6) Which of the following is not one of the four basic software development activities?

a) establishing the requirements
b) creating a design
c) preliminary practice coding
d) testing
e) implementing the design

Answer: c
Explanation: Preliminary practice coding is not one of the four basic software development activities.
Establishing the requirements for a program, creating a design for a program, implementing the design and testing the
program all occur during software development.




2
Pearson © 2014

, Java Foundations: Introduction to Program Design & Data Structures, 3e
John Lewis, Peter J. DePasquale, Joseph Chase
Test Bank: Chapter 1

7) Software requirements specify ____________________.

a) what a program should accomplish
b) which programming language the developer should use
c) how objects should be encapsulated
d) how a solution should be implemented
e) a programming schedule

Answer: a
Explanation: Software requirements specify what a program should accomplish. They do not specify how a
program or a programmer should get a program to work as it is supposed to, and therefore none of the other choices are
correct.

8) The _____________ of an object define it define its potential behaviors.

a) attributes
b) white spaces
c) variables
d) methods
e) name

Answer: d
Explanation: The methods of an object represent the objects potential behaviors. The attributes are the values that
the object stores internally, and include the objects instance variables. The name of an object has nothing to do with its
behaviors. White space is related to the program code and has nothing to do with objects.

9) Which of the following will is considered a logical error?

a) forgetting a semicolon at the end of a programming statement
b) typing a curly bracket when you should have typed a parenthesis
c) multiplying two numbers when you meant to add them
d) dividing by zero
e) misspelling an identifier

Answer: c
Explanation: Multiplying two numbers when you mean to add them is an example of a logical error, because the
program will still compile and run, but the output will be incorrect. Forgetting a semicolon, using a bracket instead of a
parenthesis and misspelling an identifier will all lead to the program failing to compile, and are therefore compile-time
errors. Dividing by zero is an example of a run-time error since it will cause the program to crash at run-time.




3
Pearson © 2014

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller ExamsExpert. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $33.58. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

72349 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$33.58
  • (0)
  Add to cart