Java: An Introduction to Problem Solving and Programming (8th Edition)
8th Edition
ISBN: 9780134462035
Author: Walter Savitch
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 12, Problem 10PP
Program Plan Intro
“GroupHolder” class
Program Plan:
- Import required package.
- Define “Main” class.
- Define “GroupHolder” class
- Create an array list “items” from “GroupHolder” class.
- Method definition for “findGroupNodeFor”
- Declare variable using “GroupNode” type.
- Set node “n” to “null”.
- Set “found” to “false”.
- Check condition using “while” loop
- Compute next node.
- If “n” equal to “s”, then set “found” to “true”.
- If found, then returns the value of “n”.
- Otherwise, returns null.
- Method definition of “addItem”.
- Call “findGroupNodeFor” method and store it to a variable “n”.
- If “n” is null, then add it to “items”.
- Method definition for “getRepresentative”.
- Call “findGroupNodeFor” method and store it to a variable “n”.
- Check condition using “while” loop.
- Set node to link value at node
- Finally returns the data at node.
- Set node to link value at node
- Method definition of “getAllRepresentatives”.
- Create an array list.
- Add data to “items”.
- Finally returns the result.
- Method definition of “inSameGroup”.
- Assign representative for string “s1” and store result to “r1”.
- Assign representative for string “s2” and store result to “r2”.
- Returns result.
- Method definition of “union”
- Assign representative for string “s1” and store result to “r1”.
- Assign representative for string “s2” and store result to “r2”.
- Check condition.
- Find group node for “r1” and “r2”.
- Create “GroupNode” class.
- Declare required variables.
- Create constructor for “GroupNode” class.
- Create parameterized for “GroupNode” class.
- Define main function.
- Create object “g” from “GroupHolder” class.
- Add item to “g” by calling the method “addItem”.
- Display groups by calling the method “getAllRepresentatives”.
- Join groups by calling the method “union”.
- Display groups after performing unions operations.
- Check “a” and “e” is in same group by calling method “inSameGroup”.
- Check “a” and “f” is in same group by calling method “inSameGroup”.
- Define “GroupHolder” class
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
A
Solve each member force of the truss shown below.
F
30 kN
E
30 kN
3 m
3 m
D
C
B
4 m
4 m
4 m
4 m
5:11 PM Fri Dec 13
Tt
Problem 8 should be answered as a triple quoted
comment after the code
PROBLEM G. Put your name and assignment information here.
The Bells
Edgar Allen Poe
HEAR the sledges with the bells.
Siver bells!
What a world of merriment their melody foretels
How they tinkle, tinkle, tinkle,
In the icy air of night
While the stars, that oversprinkle
All the heavens, seem to twinkle
With a crystalline delight
Keeping time, time, time.
In a sort of Runic rhyme.
To the tintinnabulation that so musically wells
From the bells, bells, bells, bells,
Bells, bells, bells
From the jingling and the tinkling of the bells
Hear the mellow wedding bels
Golden bells!
What a world of happiness their harmony foretells
Through the balmy air of night
How they ring out their delight!
From the molten-golden notes.
And all in tune.
What a liquid ditty floats
To the turtle-dove that stens, while she gloats
On the moon!
Oh, from out the sounding cells.
What a gush of euphony voluminously wells!
How…
1. Could you see yourself making a career out of being a System Analyst? why?
2. What is one question you have about being a system analyst still or the system analysis and design process?
Chapter 12 Solutions
Java: An Introduction to Problem Solving and Programming (8th Edition)
Ch. 12.1 - Suppose aList is an object of the class...Ch. 12.1 - Prob. 2STQCh. 12.1 - Prob. 3STQCh. 12.1 - Prob. 4STQCh. 12.1 - Can you use the method add to insert an element at...Ch. 12.1 - Prob. 6STQCh. 12.1 - Prob. 7STQCh. 12.1 - If you create a list using the statement...Ch. 12.1 - Prob. 9STQCh. 12.1 - Prob. 11STQ
Ch. 12.1 - Prob. 12STQCh. 12.2 - Prob. 13STQCh. 12.2 - Prob. 14STQCh. 12.2 - Prob. 15STQCh. 12.2 - Prob. 16STQCh. 12.3 - Prob. 17STQCh. 12.3 - Prob. 18STQCh. 12.3 - Prob. 19STQCh. 12.3 - Write a definition of a method isEmpty for the...Ch. 12.3 - Prob. 21STQCh. 12.3 - Prob. 22STQCh. 12.3 - Prob. 23STQCh. 12.3 - Prob. 24STQCh. 12.3 - Redefine the method getDataAtCurrent in...Ch. 12.3 - Repeat Question 25 for the method...Ch. 12.3 - Repeat Question 25 for the method...Ch. 12.3 - Repeat Question 25 for the method...Ch. 12.4 - Revise the definition of the class ListNode in...Ch. 12.4 - Prob. 30STQCh. 12.5 - What is the purpose of the FXML file?Ch. 12.5 - Prob. 32STQCh. 12 - Repeat Exercise 2 in Chapter 7, but use an...Ch. 12 - Prob. 2ECh. 12 - Prob. 3ECh. 12 - Repeat Exercises 6 and 7 in Chapter 7, but use an...Ch. 12 - Write a static method removeDuplicates...Ch. 12 - Write a static method...Ch. 12 - Write a program that will read sentences from a...Ch. 12 - Repeat Exercise 12 in Chapter 7, but use an...Ch. 12 - Write a program that will read a text file that...Ch. 12 - Revise the class StringLinkedList in Listing 12.5...Ch. 12 - Prob. 12ECh. 12 - Write some code that will use an iterator to...Ch. 12 - Prob. 14ECh. 12 - Write some code that will use an iterator to...Ch. 12 - Prob. 17ECh. 12 - Revise the method selectionSort within the class...Ch. 12 - Repeat the previous practice program, but instead...Ch. 12 - Repeat Practice Program 1, but instead write a...Ch. 12 - Write a program that allows the user to enter an...Ch. 12 - Write a program that uses a HashMap to compute a...Ch. 12 - Write a program that creates Pet objects from data...Ch. 12 - Repeat the previous programming project, but sort...Ch. 12 - Repeat the previous programming project, but read...Ch. 12 - Prob. 9PPCh. 12 - Prob. 10PPCh. 12 - Prob. 11PPCh. 12 - Prob. 12PPCh. 12 - Prob. 13PPCh. 12 - Prob. 14PPCh. 12 - Prob. 15PP
Knowledge Booster
Similar questions
- Please, don't include lots of explanation.arrow_forwardI need help writing the recursive function called powerlist that computes the power of n (given as a parameter) of the numbers in a list. I need to use map. An example of what I have to do could be powerlist([6,4,3],5)=[6^5,4^5,3^5].arrow_forwardCan you show me how to redesign the Milwaukee Rep website using HTML and CSS using Sublime Text?arrow_forward
- Problem 3 A radar speed gun is a device used in law-enforceme✗measure the speed of moving vehicles in miles per hour. The measured speeds are supposed to be stored in a file, one number per line, as follows: 65.6 70.2 54.9 Unfortunately, due to an intermittent fault, occasionally multiple numbers are written on a single line as follows: 73.2 65.6 69.8 Furthermore, occasionally the radar gun outputs a single stray character such as: 67.9z, 6$4.9, or a3.9, to illustrate just a few. Given a file that has radar speed gun readings, write a function averageSpeed() to calculate the average of the numbers in the file. Your code must adhere to the following specifications: a. Prompt the user for the name of the input file to process. When the user enters a nonexistent file name, give the user a second chance. After two wrong entries in a row, quit the program with an appropriate message. b. Ignore numbers containing stray characters. Ignore any reading for slow vehicles moving at 2 miles per…arrow_forwardWhich internet core technology provides dedicated bandwidth to each user?arrow_forwardCan you show me how to make a link of a CSS file and add it to an HTML file using Sublime Text?arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education