One of the most characters in fiction is named "Tarzan of the ." Tarzan was raised by a/an and lives in the jungle in the heart of darkest . He spends most of his time eating and swinging from tree to Whenever he gets angry, he beats on his chest and says, " !" This is his war cry. Tarzan always dresses in shorts made from the skin of a/an and his best friend is a/an chimpanzee named Cheetah. He is supposed to be able to speak to elephants and In the movies, Tarzan is played by

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
  • At least 8 lines

  • At least 5 placeholders

  • below is how to format the madlib. 
One of the most <adjective> characters in fiction is named
"Tarzan of the <plural-noun> ." Tarzan was raised by a/an
<noun> and lives in the <adjective> jungle in the
heart of darkest <place> . He spends most of his time
eating <plural-noun> and swinging from tree to <noun>
Whenever he gets angry, he beats on his chest and says,
" <funny-noise> !" This is his war cry. Tarzan always dresses in
<adjective> shorts made from the skin of a/an <noun>
and his best friend is a/an <adjective> chimpanzee named
Cheetah. He is supposed to be able to speak to elephants and
<plural-noun>
In the movies, Tarzan is played by <person's-name>
Transcribed Image Text:One of the most <adjective> characters in fiction is named "Tarzan of the <plural-noun> ." Tarzan was raised by a/an <noun> and lives in the <adjective> jungle in the heart of darkest <place> . He spends most of his time eating <plural-noun> and swinging from tree to <noun> Whenever he gets angry, he beats on his chest and says, " <funny-noise> !" This is his war cry. Tarzan always dresses in <adjective> shorts made from the skin of a/an <noun> and his best friend is a/an <adjective> chimpanzee named Cheetah. He is supposed to be able to speak to elephants and <plural-noun> In the movies, Tarzan is played by <person's-name>
o At least 8 lines
o At least 5 placeholders
• Clicking "Mark" will submit your
madlib
Here is an example of how you should
format your madlib:
Transcribed Image Text:o At least 8 lines o At least 5 placeholders • Clicking "Mark" will submit your madlib Here is an example of how you should format your madlib:
Expert Solution
Step 1 of 2

package string;

import java.io.*;

import java.util.*;

// Class FindReplace definition

public class FindReplace

{

// To store the string read from file

String original[];

// To store number of lines

int rows = 0;

// Method to read file contents and stores it in string array

void fileRead()

{

// To handle file not found

try

{

// Scanner class object created to read file

Scanner readF = new Scanner(new File("FindReplaceData.txt"));

// Loops till end of the file to count number of lines

while(readF.hasNextLine())

{

// Read one line at a time from file

readF.nextLine();

// Increase the row counter

rows++;

}// End of while loop

// Allocates number of rows  

original = new String[rows];

// Close the file

readF.close();

// Re opens the file for reading data

readF = new Scanner(new File("FindReplaceData.txt"));

// Reset the row counter to zero

rows = 0;

// Loops till end of the file to read data

while(readF.hasNextLine())

{

// Read one line at a time from file and stores at rows index position of original array

original[rows] = readF.nextLine();

// Increase the row counter by one

rows++;

}// End of while loop

System.out.print("\n Original Data \n");

// loops till number of rows and displays the original data

for(int y = 0; y < rows; y++)

System.out.println(original[y]);

// Close the file

readF.close();

}// End of try block

// Catch block to handle FileNotFoundException

catch(FileNotFoundException fe)

{

System.out.println("\n File not found");

}// End of catch block

}// End of method

// Method to find and replace

void findReplace()

{

// Scanner class object created to accept data from console

Scanner sc = new Scanner(System.in);

// Creates find array

String find[] = {"<adjective>", "<plural-noun>", "<noun>", "<adjective>", "<place>", "<plural-noun>", "<noun>", "<funny-noise> !",

"<adjective>", "<noun>", "<adjective>", "<plural-noun>", "<person's-name>"};

// Creates an array to store replace with string entered by the user

String replaceWith[] = new String[find.length];

// Accepts the string to replace from the user and replaces it

System.out.print("\n Please type a adjective: ");

replaceWith[0] = " " + sc.next() + " ";

original[0] = original[0].replaceAll(find[0], replaceWith[0]);

System.out.print("\n Please type a plural-noun: ");

replaceWith[1] = " " + sc.next() + " ";

original[1] = original[1].replaceAll(find[1], replaceWith[1]);

System.out.print("\n Please type a noun: ");

replaceWith[2] = " " + sc.next() + " ";

original[2] = original[2].replaceAll(find[2], replaceWith[2]);

System.out.print("\n Please type a adjective: ");

replaceWith[3] = " " + sc.next() + " ";

original[2] = original[2].replaceAll(find[3], replaceWith[3]);

System.out.print("\n Please type a place: ");

replaceWith[4] = " " + sc.next() + " ";

original[3] = original[3].replaceAll(find[4], replaceWith[4]);

System.out.print("\n Please type a plural-noun: ");

replaceWith[5] = " " + sc.next() + " ";

System.out.print("\n Please type a noun: ");

replaceWith[6] = " " + sc.next() + " ";

original[4] = original[4].replaceAll(find[5], replaceWith[5]);

original[4] = original[4].replaceAll(find[6], replaceWith[6]);

System.out.print("\n Please type a funny-noise: ");

replaceWith[7] = " " + sc.next() + " ";

original[6] = original[6].replaceAll(find[7], replaceWith[7]);

System.out.print("\n Please type a adjective: ");

replaceWith[8] = " " + sc.next() + " ";

System.out.print("\n Please type a noun: ");

replaceWith[9] = " " + sc.next() + " ";

original[7] = original[7].replaceAll(find[8], replaceWith[8]);

original[7] = original[7].replaceAll(find[9], replaceWith[9]);

System.out.print("\n Please type a adjective: ");

replaceWith[10] = " " + sc.next() + " ";

original[8] = original[8].replaceAll(find[10], replaceWith[10]);

System.out.print("\n Please type a plural-noun: ");

replaceWith[11] = " " + sc.next() + " ";

original[10] = original[10].replaceAll(find[11], replaceWith[11]);

System.out.print("\n Please type a person's-name: ");

replaceWith[12] = " " + sc.next() + " ";

original[10] = original[10].replaceAll(find[12], replaceWith[12]);

// Close the scanner

sc.close();

}// End of method

// Method to display replaced data

void display()

{

System.out.print("\n Replaced Data \n");

// loops till number of rows and displays the replaced data

for(int y = 0; y < rows; y++)

System.out.println(original[y]);

}// End of while loop

// main method definition

public static void main(String args[])

{

// Creates an object of class FindReplace

FindReplace fr = new FindReplace();

// Call the method to read file contents

fr.fileRead();

// Calls the method to find and replace

fr.findReplace();

// Calls the method to display replaced data

fr.display();

}// End of main method

}// End of class

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
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 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)
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
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY