
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Add a new method to ArrayTools with filter. Make this method accept a String array. Change all the Strings that are longer than 5 characters to uppercase.
Write in Java and use test cases 1 & 2 as a result.
![Test Case 2
How many strings? n
10 ENTER
Enter a value: \n
doltishness ENTER
Enter a value: \n
subclass ENTER
Enter a value: \n
carbonized ENTER
Enter a value: \n
myxoma ENTER
Enter a value: \n
quiring ENTER
Enter a value: \n
confutative ENTER
Enter a value: \n
weald ENTER
Enter a value: \n
unerringly ENTER
Enter a value: \n
unpensioning ENTER
Enter a value: \n
indagative ENTER
[0]: DOLTISHNESS <-- Longer than five letters \n
[1]: SUBCLASS <-- Longer than five letters \n
[2]: CARBONIZED <-- Longer than five letters \n
[3]: MYXOMA <-- Longer than five letters \n
[4]: QUIRING <-- Longer than five letters \n
[5]: CONFUTATIVE <-- Longer than five letters \n
[6]: weald \n
[7]: UNERRINGLY <-- Longer than five letters \n
[8]: UNPENSIONING <-- Longer than five letters \n
[9]: INDAGATIVE <-- Longer than five letters \n](https://content.bartleby.com/qna-images/question/3064d3b4-17c7-48fb-b797-1fcca0646f95/8a4e0749-fc2d-4d05-8de0-df91625abeb5/x5mpukl_thumbnail.png)
Transcribed Image Text:Test Case 2
How many strings? n
10 ENTER
Enter a value: \n
doltishness ENTER
Enter a value: \n
subclass ENTER
Enter a value: \n
carbonized ENTER
Enter a value: \n
myxoma ENTER
Enter a value: \n
quiring ENTER
Enter a value: \n
confutative ENTER
Enter a value: \n
weald ENTER
Enter a value: \n
unerringly ENTER
Enter a value: \n
unpensioning ENTER
Enter a value: \n
indagative ENTER
[0]: DOLTISHNESS <-- Longer than five letters \n
[1]: SUBCLASS <-- Longer than five letters \n
[2]: CARBONIZED <-- Longer than five letters \n
[3]: MYXOMA <-- Longer than five letters \n
[4]: QUIRING <-- Longer than five letters \n
[5]: CONFUTATIVE <-- Longer than five letters \n
[6]: weald \n
[7]: UNERRINGLY <-- Longer than five letters \n
[8]: UNPENSIONING <-- Longer than five letters \n
[9]: INDAGATIVE <-- Longer than five letters \n
![Test Case 1
How many strings? n
8 ENTER
Enter a value: An
aaaaaa ENTER
Enter a value: \n
aaaaa ENTER
Enter a value: \n
aaaa ENTER
Enter a value: \n
aaa ENTER
Enter a value: \n
aa ENTER
Enter a value: \n
a ENTER
Enter a value: \n
aaaaaaa ENTER
Enter a value: \n
hello world does this thing Work? ENTER
[0]: AAAAAA <-- Longer than five letters \n
[1]: аaaaa | \n
[2]: аaaa\n
[3]: aaa n
[4]: aa \n
[5]: a \n
[6]: AAAAAAA <-- Longer than five letters \n
[7]: HELLO WORLD DOES THIS THING WORK? <-- Longer than five letters \n](https://content.bartleby.com/qna-images/question/3064d3b4-17c7-48fb-b797-1fcca0646f95/8a4e0749-fc2d-4d05-8de0-df91625abeb5/6gidzg_thumbnail.png)
Transcribed Image Text:Test Case 1
How many strings? n
8 ENTER
Enter a value: An
aaaaaa ENTER
Enter a value: \n
aaaaa ENTER
Enter a value: \n
aaaa ENTER
Enter a value: \n
aaa ENTER
Enter a value: \n
aa ENTER
Enter a value: \n
a ENTER
Enter a value: \n
aaaaaaa ENTER
Enter a value: \n
hello world does this thing Work? ENTER
[0]: AAAAAA <-- Longer than five letters \n
[1]: аaaaa | \n
[2]: аaaa\n
[3]: aaa n
[4]: aa \n
[5]: a \n
[6]: AAAAAAA <-- Longer than five letters \n
[7]: HELLO WORLD DOES THIS THING WORK? <-- Longer than five letters \n
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 3 images

Knowledge Booster
Similar questions
- Write two methods, myCode() and helloWorld(String[] args). The myCode() method must: 1. Create a String array with these elements: "Hello" "World" 2. Call helloWorld(String[] args) method, using the array you created as the parameter. The helloWorld(String[] args) method must: 1. Replace the word "World" with the word "CityTech".arrow_forwardCreate the compareTo method for a class that represents an individual whose first and last names are stored as two Strings. In an alphabetical list of people with last names first and then first names, one individual is "less than" another if they come before the other.(as is typical).arrow_forwardwrite a code in java that has a row of 3 and a column of 3 and prints out the even numbers but if there is an odd number it instead prints it the space blankarrow_forward
- Write a method to replace all spaces in a string with '%20'. You may assume that the stringhas sufficient space at the end to hold the additional characters, and that you are given the "true"length of the string. (Note: If implementing in Java, please use a character array so that you canperform this operation in place.)EXAMPLEInput: "Mr John Smith ", 13Output: "Mr%20John%20Smith"arrow_forwardUpdate Bresenham's line (JAVA) method such that you can scale the line before drawing it. Normally, you pass two points and a Graphics' object to draw line using Bresenham's algorithm. Now you'll add scaling factors in arguments for scaling as shown below. public void drawBresenhamline(Point p1, Point p2, double Sx, double Sy, Graphics g) { I/write your code here } Note:If you use scaling method, then also write Scale method in solution.arrow_forwardIn java, Write a method void popMult(int k) for the ArrayBoundedStack class which will pop k items from this. Throw a StackUnderflowException and don't pop anything if there are fewer than k items on this. This is a method of the ArrayBoundedStack class. DO NOT USE ANY OTHER METHODS OF THE ARRAYBOUNDEDSTACK CLASS.arrow_forward
- how would you do this in a simple way? this is a non graded practice labarrow_forward4. Say we wanted to get an iterator for an ArrayList and use it to loop over all items and print them to the console. What would the code look like for this? 5. Write a method signature for a method called foo that takes an array as an argument. The return type is void. 6. What is the difference between remove and clear in ArrayLists.arrow_forwardHello! I need some help with my Java homework. Please use Eclipse Please add comments to the to program so I can understand what the code is doing and learn Create a new Eclipse project named so as to include your name (eg smith15 or jones15). In this project, create a new package with the same name as the project. In this package, write a solution to the exercise noted below. Implement the following method that returns the maximum element in an array: public static <E extends Comparable<E>> E max(E[] list) Write a test program that generates 10 random integers, invokes this method to find the max, and then displays the random integers sorted smallest to largest and then prints the value returned from the method. Max sure the the last sorted and returned value as the same!arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY