Loading...

Messages

Proposals

Stuck in your homework and missing deadline? Get urgent help in $10/Page with 24 hours deadline

Get Urgent Writing Help In Your Essays, Assignments, Homeworks, Dissertation, Thesis Or Coursework & Achieve A+ Grades.

Privacy Guaranteed - 100% Plagiarism Free Writing - Free Turnitin Report - Professional And Experienced Writers - 24/7 Online Support

Daniel liang introduction to java programming solutions

16/11/2021 Client: muhammad11 Deadline: 2 Day

ISSLJC-SETUP-ALIEN-PAREU-BEGUN-LIKES

Digital Resources for Students

Your new textbook provides 12-month access to digital resources that may include VideoNotes (step-by-step video tutorials on programming concepts), source code, web chapters, quizzes, and more. Refer to the preface in the textbook for a detailed list of resources.

Follow the instructions below to register for the Companion Website for Daniel Liang’s Introduction to Java™ Programming and Data Structures, Comprehensive Version, Eleventh Edition, Global Edition.

1. Go to www.pearsonglobaleditions.com/liang 2. Enter the title of your textbook or browse by author name. 3. Click Companion Website. 4. Click Register and follow the on-screen instructions to create a login name and password.

Use a coin to scratch off the coating and reveal your access code. Do not use a sharp knife or other sharp object as it may damage the code.

Use the login name and password you created during registration to start using the digital resources that accompany your textbook.

IMPORTANT: This prepaid subscription does not include access to MyProgrammingLab, which is available at www.myprogramminglab.com for purchase.

This access code can only be used once. This subscription is valid for 12 months upon activation and is not transferable. If the access code has already been revealed it may no longer be valid.

For technical support go to https://support.pearson.com/getsupport

Liang_11_1292221879_ifc_Final.indd 1 17/11/17 9:19 PM

Digital Resources for Students

Your new textbook provides 12-month access to digital resources that may include VideoNotes (step-by-step video tutorials on programming concepts), source code, web chapters, quizzes, and more. Refer to the preface in the textbook for a detailed list of resources.

Follow the instructions below to register for the Companion Website for Daniel Liang’s Introduction to Java™ Programming and Data Structures, Comprehensive Version, Eleventh Edition, Global Edition.

1. Go to www.pearsonglobaleditions.com/liang 2. Enter the title of your textbook or browse by author name. 3. Click Companion Website. 4. Click Register and follow the on-screen instructions to create a login name and password.

Use a coin to scratch off the coating and reveal your access code. Do not use a sharp knife or other sharp object as it may damage the code.

Use the login name and password you created during registration to start using the digital resources that accompany your textbook.

IMPORTANT: This prepaid subscription does not include access to MyProgrammingLab, which is available at www.myprogramminglab.com for purchase.

This access code can only be used once. This subscription is valid for 12 months upon activation and is not transferable. If the access code has already been revealed it may no longer be valid.

For technical support go to https://support.pearson.com/getsupport

Liang_11_1292221879_ifc_Final.indd 1 17/11/17 9:19 PM Digital_Resources_for_Students.indd 1 1/17/18 8:14 PM

IntroductIon to

Java ProgrammIng and

data StructureS comPrehenSIve verSIon

Eleventh Edition

Global Edition

Y. daniel Liang Armstrong State University

330 Hudson Street, NY NY 10013

A01_LIAN1878_11_GE_FM.indd 1 1/2/18 11:57 PM

To Samantha, Michael, and Michelle

Java™ and Netbeans™ screenshots ©2017 by Oracle Corporation, all rights reserved. Reprinted with permission. Credits and acknowledgments borrowed from other sources and reproduced, with permission, in this textbook appear on the appropriate page within text. Microsoft and/or its respective suppliers make no representations about the suit- ability of the information contained in the documents and related graphics published as part of the services for any purpose. All such documents and related graphics are provided “as is” without warranty of any kind. Microsoft and/ or its respective suppliers hereby disclaim all warranties and conditions with regard to this information, including all warranties and conditions of merchantability, whether express, implied or statutory, fitness for a particular purpose, title and non-infringement. In no event shall Microsoft and/or its respective suppliers be liable for any special, indi- rect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of information available from the services. The documents and related graphics contained herein could include techni- cal inaccuracies or typographical errors. Changes are periodically added to the information herein. Microsoft and/or its respective suppliers may make improvements and/or changes in the product(s) and/or the program(s) described herein at any time. Partial screen shots may be viewed in full within the software version specified.

Pearson Education Limited KAO Two KAO Park Harlow CM17 9NA United Kingdom

and Associated Companies throughout the world

Visit us on the World Wide Web at: www.pearsonglobaleditions.com

© Pearson Education Limited 2019

The rights of Y. Daniel Liang to be identified as the author of this work have been asserted by him in accordance with the Copyright, Designs and Patents Act 1988.

Authorized adaptation from the United States edition, entitled Introduction to Java Programming and Data Structures, Comprehensive Version, 11th Edition, ISBN 978-0-13-467094-2 by Y. Daniel Liang, published by Pearson Education © 2018.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without either the prior written permission of the publisher or a license permitting restricted copying in the United Kingdom issued by the Copyright Licensing Agency Ltd, Saffron House, 6–10 Kirby Street, London EC1N 8TS.

All trademarks used herein are the property of their respective owners. The use of any trademark in this text does not vest in the author or publisher any trademark ownership rights in such trademarks, nor does the use of such trademarks imply any affiliation with or endorsement of this book by such owners.

British Library Cataloguing-in-Publication Data A catalogue record for this book is available from the British Library

10 9 8 7 6 5 4 3 2 1

Typeset by SPi Global ISBN-10: 1-292-22187-9

Printed and bound by Vivar in Malaysia ISBN-13: 978-1-292-22187-8

Senior Vice President Courseware Portfolio Management: Marcia J. Horton

Director, Portfolio Management: Engineering, Computer Science & Global Editions: Julian Partridge

Higher Ed Portfolio Management: Tracy Johnson (Dunkelberger)

Portfolio Management Assistant: Kristy Alaura Managing Content Producer: Scott Disanno Content Producer: Robert Engelhardt Web Developer: Steve Wright Assistant Acquisitions Editor, Global Edition:

Aditee Agarwal Assistant Project Editor, Global Edition: Shaoni

Mukherjee

Manager, Media Production, Global Edition: Vikram Kumar

Senior Manufacturing Controller, Production, Global Edition: Jerry Kataria

Rights and Permissions Manager: Ben Ferrini Manufacturing Buyer, Higher Ed, Lake Side

Communications Inc (LSC): Maura Zaldivar-Garcia Inventory Manager: Ann Lam Marketing Manager: Demetrius Hall Product Marketing Manager: Bram Van Kempen Marketing Assistant: Jon Bryant Cover Designer: Lumina Datamatics Cover Image: Eduardo Rocha/ shutterstock.com Full-Service Project Management: Shylaja Gattupalli,

SPi Global

A01_LIAN1878_11_GE_FM.indd 2 1/2/18 11:57 PM

3

Dear Reader,

Many of you have provided feedback on earlier editions of this book, and your comments and suggestions have greatly improved the book. This edition has been substantially enhanced in presentation, organization, examples, exercises, and supplements.

The book is fundamentals first by introducing basic programming concepts and techniques before designing custom classes. The fundamental concepts and techniques of selection statements, loops, methods, and arrays are the foundation for programming. Building this strong foundation prepares students to learn object-oriented programming and advanced Java programming.

This book teaches programming in a problem-driven way that focuses on problem solv- ing rather than syntax. We make introductory programming interesting by using thought- provoking problems in a broad context. The central thread of early chapters is on problem solving. Appropriate syntax and library are introduced to enable readers to write programs for solving the problems. To support the teaching of programming in a problem-driven way, the book provides a wide variety of problems at various levels of difficulty to motivate students. To appeal to students in all majors, the problems cover many application areas, including math, science, business, financial, gaming, animation, and multimedia.

The book seamlessly integrates programming, data structures, and algorithms into one text. It employs a practical approach to teach data structures. We first introduce how to use various data structures to develop efficient algorithms, and then show how to implement these data structures. Through implementation, students gain a deep understanding on the efficiency of data structures and on how and when to use certain data structures. Finally, we design and implement custom data structures for trees and graphs.

The book is widely used in the introductory programming, data structures, and algorithms courses in the universities around the world. This comprehensive version covers fundamen- tals of programming, object-oriented programming, GUI programming, data structures, algo- rithms, concurrency, networking, database, and Web programming. It is designed to prepare students to become proficient Java programmers. A brief version (Introduction to Java Pro- gramming, Brief Version, Eleventh Edition, Global Edition) is available for a first course on programming, commonly known as CS1. The brief version contains the first 18 chapters of the comprehensive version.

The best way to teach programming is by example, and the only way to learn programming is by doing. Basic concepts are explained by example and a large number of exercises with various levels of difficulty are provided for students to practice. For our programming courses, we assign programming exercises after each lecture.

Our goal is to produce a text that teaches problem solving and programming in a broad context using a wide variety of interesting examples. If you have any comments on and suggestions for improving the book, please email me.

Sincerely,

Y. Daniel Liang y.daniel.liang@gmail.com www.pearsonglobaleditions.com/Liang

fundamentals-first

problem-driven

data structures

comprehensive version

brief version

Preface

A01_LIAN1878_11_GE_FM.indd 3 1/2/18 11:57 PM

4 Preface

ACM/IEEE Curricular 2013 and ABET Course Assessment The new ACM/IEEE Computer Science Curricular 2013 defines the Body of Knowledge organized into 18 Knowledge Areas. To help instructors design the courses based on this book, we provide sample syllabi to identify the Knowledge Areas and Knowledge Units. The sample syllabi are for a three semester course sequence and serve as an example for institutional customization. The sample syllabi are accessible from the Instructor Resource Center.

Many of our users are from the ABET-accredited programs. A key component of the ABET accreditation is to identify the weakness through continuous course assessment against the course outcomes. We provide sample course outcomes for the courses and sam- ple exams for measuring course outcomes on the Instructor Resource Center.

What’s New in This Edition? This edition is completely revised in every detail to enhance clarity, presentation, content, examples, and exercises. The major improvements are as follows:

■■ The book’s title is changed to Introduction to Java Programming and Data Structures with new enhancements on data structures. The book uses a practical approach to introduce design, implement, and use data structures and covers all topics in a typical data structures course. Additionally, it provides bonus chapters that cover advanced data structures such as 2-4 trees, B-trees, and red-black trees.

■■ Updated to the latest Java technology. Examples and exercises are improved and simplified by using the new features in Java 8.

■■ The default and static methods are introduced for interfaces in Chapter 13.

■■ The GUI chapters are updated to JavaFX 8. The examples are revised. The user interfaces in the examples and exercises are now resizable and displayed in the center of the window.

■■ Inner classes, anonymous inner classes, and lambda expressions are covered using practi- cal examples in Chapter 15.

■■ More examples and exercises in the data structures chapters use lambda expressions to simplify coding. Method references are introduced along with the Comparator interface in Section 20.6.

■■ The forEach method is introduced in Chapter 20 as a simple alternative to the foreach loop for applying an action to each element in a collection.

■■ Use the default methods for interfaces in Java 8 to redesign and simplify MyList, MyArrayList, MyLinkedList, Tree, BST, AVLTree, MyMap, MyHashMap, MySet, MyHashSet, Graph, UnweightedGraph, and WeightedGraph in Chapters 24–29.

■■ Chapter 30 is brand new to introduce aggregate operations for collection streams.

■■ FXML and the Scene Builder visual tool are introduced in Chapter 31.

■■ The Companion Website has been redesigned with new interactive quiz, CheckPoint ques- tions, animations, and live coding.

■■ More than 200 additional programming exercises with solutions are provided to the instructor on the Instructor Resource Center. These exercises are not printed in the text.

A01_LIAN1878_11_GE_FM.indd 4 1/2/18 11:57 PM

Preface 5

Pedagogical Features The book uses the following elements to help students get the most from the material:

■■ The Objectives at the beginning of each chapter list what students should learn from the chapter. This will help them determine whether they have met the objectives after completing the chapter.

■■ The Introduction opens the discussion with a thought-provoking question to motivate the reader to delve into the chapter.

■■ Key Points highlight the important concepts covered in each section.

■■ Check Points provide review questions to help students track their progress as they read through the chapter and evaluate their learning.

■■ Problems and Case Studies, carefully chosen and presented in an easy-to-follow style, teach problem solving and programming concepts. The book uses many small, simple, and stimulating examples to demonstrate important ideas.

■■ The Chapter Summary reviews the important subjects that students should understand and remember. It helps them reinforce the key concepts they have learned in the chapter.

■■ Quizzes are accessible online, grouped by sections, for students to do self-test on programming concepts and techniques.

■■ Programming Exercises are grouped by sections to provide students with opportunities to apply the new skills they have learned on their own. The level of difficulty is rated as easy (no asterisk), moderate (*), hard (**), or challenging (***). The trick of learning program- ming is practice, practice, and practice. To that end, the book provides a great many exer- cises. Additionally, more than 200 programming exercises with solutions are provided to the instructors on the Instructor Resource Center. These exercises are not printed in the text.

■■ Notes, Tips, Cautions, and Design Guides are inserted throughout the text to offer valuable advice and insight on important aspects of program development.

Note Provides additional information on the subject and reinforces important concepts.

Tip Teaches good programming style and practice.

Caution Helps students steer away from the pitfalls of programming errors.

Design Guide Provides guidelines for designing programs.

Flexible Chapter Orderings The book is designed to provide flexible chapter orderings to enable GUI, exception handling, recursion, generics, and the Java Collections Framework to be covered earlier or later. The diagram on the next page shows the chapter dependencies.

A01_LIAN1878_11_GE_FM.indd 5 1/2/18 11:57 PM

C ha

pt er

3 9

Ja va

Se rv

er F

ac es

C ha

pt er

4 0

R M

I

C ha

pt er

4 1

W eb

S er

vi ce

s

C ha

pt er

4 4

T es

ti ng

U si

ng J

U ni

t

C ha

pt er

3 8

Ja va

Se rv

er P

ag es

C ha

pt er

2 5

B in

ar y

Se ar

ch T

re es

C ha

pt er

2 6

A V

L T

re es

C ha

pt er

2 9

W ei

gh te

d G

ra ph

s an

d A

pp lic

at io

ns

C ha

pt er

2 8

G ra

ph s

an d

A

pp lic

at io

ns

C ha

pt er

2 1

Se ts

a nd

M ap

s

C ha

pt er

2 2

D ev

el op

pi ng

E

f� ci

en t A

lg or

it hm

s

C ha

pt er

1 I

nt ro

du ct

io n

to

C om

pu te

rs , P

ro gr

am s,

a nd

J

av a

C ha

pt er

2 E

le m

en ta

ry

P ro

gr am

m in

g

C ha

pt er

5 L

oo ps

C ha

pt er

7 S

in gl

e- D

im en

si on

al

A rr

ay s

C ha

pt er

8 M

ul ti

di m

en si

on al

A

rr ay

s

C ha

pt er

4 M

at he

m at

ic al

F

un ct

io ns

, C ha

ra ct

er s,

a

nd S

tr in

gs

P ar

t I : F

un da

m en

ta ls

o f

P

ro gr

am m

in g

C ha

pt er

3 S

el ec

ti on

s

C ha

pt er

9 O

bj ec

ts a

nd C

la ss

es

C ha

pt er

1 7

B in

ar y

I/ O

N ot

e: C

ha pt

er s

1– 18

a re

in th

e br

ie f v

er si

on o

f t hi

s bo

ok .

N ot

e: C

ha pt

er s

1– 30

a re

in th

e co

m pr

eh en

si ve

v er

si on

.

N ot

e: C

ha pt

er s

31 –4

4 ar

e bo

nu s

ch ap

te rs

a va

ila bl

e fr

om th

e C

om pa

ni on

W eb

si te

.

C ha

pt er

1 0

T hi

nk in

g in

O bj

ec ts

C ha

pt er

1 1

In he

ri ta

nc e

an d

P

ol ym

or ph

is m

C ha

pt er

1 2

E xc

ep ti

on

H an

dl in

g a

nd T

ex t I

/O

C ha

pt er

1 3

A bs

tr ac

t C la

ss es

a

nd I

nt er

fa ce

s

C ha

pt er

6 M

et ho

ds

P ar

t I I:

O bj

ec t-

O ri

en te

d

P ro

gr am

m in

g

C ha

pt er

3 2

M ul

ti th

re ad

in g

an d

P ar

al le

l P ro

gr am

m in

g

C ha

pt er

3 6

In te

rn at

io na

liz at

io n

C ha

pt er

3 3

N et

w or

ki ng

C ha

pt er

3 4

Ja va

D at

ab as

e

P

ro gr

am m

in g

C ha

pt er

3 5

A dv

an ce

d D

at ab

as e

P ro

gr am

m in

g

C ha

pt er

3 7

Se rv

le ts

P ar

t V : A

dv an

ce d

Ja va

P

ro gr

am m

in g

C ha

pt er

1 4

Ja va

F X

B as

ic s

C ha

pt er

1 5

E ve

nt -D

ri ve

n

P ro

gr am

m in

g an

d

A ni

m at

io ns

C ha

pt er

2 0

L is

ts , S

ta ck

s, Q

ue ue

s,

a nd

P ri

or it

y Q

ue ue

s C

ha pt

er 1

6 Ja

va F

X C

on tr

ol s

a

nd M

ul ti

m ed

ia

C ha

pt er

3 1

A dv

an ce

d J

av aF

X

a nd

F X

M L

P ar

t I II

: G U

I P

ro gr

am m

in g

C ha

pt er

1 8

R ec

ur si

on C

h 7

C ha

pt er

1 9

G en

er ic

s

C ha

pt er

2 4

Im pl

em en

ti ng

L is

ts ,

S

ta ck

s, Q

ue ue

s, a

nd P

ri or

it y

Q

ue ue

s

P ar

t I V

: D at

a St

ru ct

ur es

Homework is Completed By:

Writer Writer Name Amount Client Comments & Rating
Instant Homework Helper

ONLINE

Instant Homework Helper

$36

She helped me in last minute in a very reasonable price. She is a lifesaver, I got A+ grade in my homework, I will surely hire her again for my next assignments, Thumbs Up!

Order & Get This Solution Within 3 Hours in $25/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 3 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 6 Hours in $20/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 6 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 12 Hours in $15/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 12 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

6 writers have sent their proposals to do this homework:

Quality Assignments
Solution Provider
Assignment Hut
Academic Master
A+GRADE HELPER
Unique Academic Solutions
Writer Writer Name Offer Chat
Quality Assignments

ONLINE

Quality Assignments

I have worked on wide variety of research papers including; Analytical research paper, Argumentative research paper, Interpretative research, experimental research etc.

$41 Chat With Writer
Solution Provider

ONLINE

Solution Provider

I can assist you in plagiarism free writing as I have already done several related projects of writing. I have a master qualification with 5 years’ experience in; Essay Writing, Case Study Writing, Report Writing.

$28 Chat With Writer
Assignment Hut

ONLINE

Assignment Hut

I have assisted scholars, business persons, startups, entrepreneurs, marketers, managers etc in their, pitches, presentations, market research, business plans etc.

$47 Chat With Writer
Academic Master

ONLINE

Academic Master

This project is my strength and I can fulfill your requirements properly within your given deadline. I always give plagiarism-free work to my clients at very competitive prices.

$46 Chat With Writer
A+GRADE HELPER

ONLINE

A+GRADE HELPER

I have done dissertations, thesis, reports related to these topics, and I cover all the CHAPTERS accordingly and provide proper updates on the project.

$24 Chat With Writer
Unique Academic Solutions

ONLINE

Unique Academic Solutions

I will be delighted to work on your project. As an experienced writer, I can provide you top quality, well researched, concise and error-free work within your provided deadline at very reasonable prices.

$44 Chat With Writer

Let our expert academic writers to help you in achieving a+ grades in your homework, assignment, quiz or exam.

Similar Homework Questions

Aco vs mco - Florida southwestern state college online courses - Bosch ve pump operation - Mcdonald's supply and demand analysis - Monash computer science electives - What is the research approach (quantitative or qualitative) and design type (phenomenological, quasi-experimental, case study, narrative, etc.)? - Regression analysis in managerial economics - Week 5 - Computer work - The fluid mosaic model presents the modern view of - Differentiated instruction lesson plan template - History of hyperbolic functions - HRM/498T: Strategic Human Resource Management And Emerging Issues - Trade promotion optimization ppt - Camray utility 25 32 - Paramount insurance accredited hospitals - How are inventory levels monitored in retail stores - Constant voltage diode model - Leadership Skills - charismatic leadership - Beck depression inventory bdi ii test - Cpalms 119030 - Define the key biographical characteristics - The Sociological Imagination and Social Causes of Suicide - Summary of the destructors by greene - The puzzle of motivation ted talk - In the jailhouse now karaoke - Double complementary color harmony - Matlab Easy Question - Harper group pty ltd - Christopher vogler 12 stages - The north west telegraph - Operation mangement - Veeder root tls 300 troubleshooting - Unilever canada redefining the axe brand case analysis - Effects of drugs on pulsation rate of lumbriculus variegatus - Gingin district high school - 9.2 data distributions and outliers practice and problem solving - COM 510 Discussion - The dulac box plant produces 500 - 2 page - Telstra byo mobile plans $39 - Essay about education should be free for everyone - Swing equation in power system stability ppt - Basics of information technology ppt - Life perpetuates itself at the cellular level - Light and plant growth virtual lab journal answers - Marxist literary criticism ppt - Ashford sanders sunday best audition - Religious site visit essay - University of texas map - Leadership and management models mgt 410 - Fish chips electronics excel - Secondary school leaving certificate sample - Applying snp profiles to drug choices - Deep sea world tickets - The reading tutor program - Public Human Module 1 Discussion - Dr osman charles town wv - Which type of production process is likely used by a paint manufacturer to produce paint? - Cwv 101 ethical dilemma - Accounting for Private Versus Public Companies I - Bus 100 assignment 3 step 6 - Folstein mini mental state exam pdf - Is tara bethan married - Purnell model - The wild wired west summary - Map of the hunger games districts - Safety gloves protect your fingers and crossword answers - Paul durcan father's day - Wgu c361 task 1 2018 - College algebra pearson 11th edition - Goals and objectives worksheet bshs 405 - Net present value and other investment criteria solutions - Final Narrative Paper - Ambulatory care royal north shore - Code of practice: first aid in the workplace - Essay - Building a Secure Network Part 1 - Dr mrs vandertramp verbs - How to measure current on a breadboard - What effect does creativity have on society and culture - Review - Fix it - In cell h15 enter a vlookup function - Hyundai motors is considering three sites - Ethics - Discussion Post - Stakeholder - analysis - Greek club liverpool nsw 2170 - Does the center hold an introduction to western philosophy - 10/31 awaba street mosman - John and rosie gasworks north melbourne - Athlean x max size results - Nursing - OperationsManagementForLeaders_Assessment1 - Zalewska v county of sullivan - How to measure calcium content in milk - Modern database management 11e pdf - Written Discussion: Critical Listening/Careful Listening While viewing the following two videos, listen carefully. Answer questions Due Tomorrow 9/02/2020 by 7:00 pm pacific USA time. - Gary hamel on busting bureaucracy - The boy in the striped pyjamas summary - Discussion