
EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
expand_more
expand_more
format_list_bulleted
Question
thumb_up100%

Transcribed Image Text:Example Execution Trace
You must exactly match the below layout.
Melcome to a fun word replacement game
Enter the name of the file to use:
examplel.txt
Please give a name
Mark
Please give a place
Drexe ї
Please give a day of the week
Friday
Please give a time
Please give a verb
eat
Please give an animal
Please give a body part
mouth
Here is your story:
Mark is having a party! It's going to be at Drexel
on Friday. Please make sure to show up at noon,
or else you will be required to eat a/an raccoon
with your mouth
Expert Solution

Step by stepSolved in 7 steps with 1 images

Knowledge Booster
Similar questions
The FKGLF is: 0.39(totalWords/totalSentences) + 11.8(totalSyllables/totalWords) - 15.59Using the FKGLF and your knowledge of how to input and output text files with Java, write an application that will:
Take in a text file (anyText.txt),
Correct the spelling then save to another file (anyTextCorrected.txt),
Calculate the grade level.
Outputs. Your solution needs to return: the number of words in the text, the number of spelling errors corrected with the misspelled words listed, the number of sentences in the text, the number of syllables in the text, and the Flesch-Kincaid Grade Level.
One assumption you can make is the accuracy of SpellChecker(). You have access to the Java method SpellChecker that takes in a string, assumed to be a word, and returns a correctly spelled word. (Note: If the word returned is different than the word input, then there was a spelling error.)
One Constraint: This program requires two classes: GradeLevel and GradeLevelTest. GradeLevel will be the…
arrow_forward
Java Program /The Output attached by image
OverviewYou should enter this task, ask the user for a word and then search for a file to see if that word is among the words in the file.
Task
This exercise comes with three text files named wordlist1.txt, wordlist2.txt and wordlist3.txt. These files contain a large amount of words in English. Each file contains more and more words. Each word in these files is on a separate line and the words contain only lowercase letters. Your task is to write a program that reads all these words from the file and checks if a keyword, which the user entered, is among the entered words. The program should also count the total number of words contained in the file used. The program should measure how long it takes to complete the search, ie how long it takes to read all the words and check if the keyword is among the words or not.
The program should start by asking the user for the word to be searched for. Then the words in the file should be counted and…
arrow_forward
Java Program /The Output attached by image
OverviewYou should enter this task, ask the user for a word and then search for a file to see if that word is among the words in the file.
Task
This exercise comes with three text files named wordlist1.txt, wordlist2.txt and wordlist3.txt. These files contain a large amount of words in English. Each file contains more and more words. Each word in these files is on a separate line and the words contain only lowercase letters. Your task is to write a program that reads all these words from the file and checks if a keyword, which the user entered, is among the entered words. The program should also count the total number of words contained in the file used. The program should measure how long it takes to complete the search, ie how long it takes to read all the words and check if the keyword is among the words or not.
The program should start by asking the user for the word to be searched for. Then the words in the file should be counted and…
arrow_forward
If you have downloaded the source code from this book's companion web site, youwill find the following files in the Chapter 07 folder:• GirlNames.txt--This file contains a list of the 200 most popular names given togirls born in the United States from the year 2000 through 2009.• BoyNames.txt--This file contains a list of the 200 most popular names given toboys born in the United States from the year 2000 through 2009.Write a program that reads the contents of the two files into two separatelists, allows a user to input either a girl's name, a boy's name, orboth, then tells the user whether the name(s) was/were popular between 2000 and2009.First, the program should prompt the user to choose a girl's name, a boy's name,or both by entering either 'girl', 'boy', or 'both.'Once they have chosen, they should be able to input a name. If the name wasa popular name, like Jacob or Sophia, the program should print "Jacob was apopular boy's name between 2000 and 2009." or "Sophia was a popular…
arrow_forward
If you have downloaded the source code from this book's companion web site, youwill find the following files in the Chapter 07 folder:• GirlNames.txt--This file contains a list of the 200 most popular names given togirls born in the United States from the year 2000 through 2009.• BoyNames.txt--This file contains a list of the 200 most popular names given toboys born in the United States from the year 2000 through 2009.Write a program that reads the contents of the two files into two separatelists, allows a user to input either a girl's name, a boy's name, orboth, then tells the user whether the name(s) was/were popular between 2000 and2009.First, the program should prompt the user to choose a girl's name, a boy's name,or both by entering either 'girl', 'boy', or 'both.'Once they have chosen, they should be able to input a name. If the name wasa popular name, like Jacob or Sophia, the program should print "Jacob was apopular boy's name between 2000 and 2009." or "Sophia was a popular…
arrow_forward
OverviewYou should enter this task, ask the user for a word and then search for a file to see if that word is among the words in the file.
Task
Write a java programThis exercise comes with three text files named wordlist1.txt, wordlist2.txt and wordlist3.txt. These files contain a large amount of words in English. Each file contains more and more words. Each word in these files is on a separate line and the words contain only lowercase letters. Your task is to write a program that reads all these words from the file and checks if a keyword, which the user entered, is among the entered words. The program should also count the total number of words contained in the file used. The program should measure how long it takes to complete the search, ie how long it takes to read all the words and check if the keyword is among the words or not.
The program should start by asking the user for the word to be searched for. Then the words in the file should be counted and compared if the keyword…
arrow_forward
Modify songVerse to play "The Name Game" (see OxfordDictionaries.com), by replacing "(Name)" with userName but without the first letter.Ex: If userName = "Katie" and songVerse = "Banana-fana fo-f(Name)!", the program prints:Banana-fana fo-fatie!
Ex: If userName = "Katie" and songVerse = "Fee fi mo-m(Name)", the program prints:Fee fi mo-matie
Note: You may assume songVerse will always contain the substring "(Name)"
#include <iostream>#include <string>using namespace std;
int main() {string userName;string songVerse;
getline(cin, userName);userName = userName.substr(1, userName.size() - 1); // Remove first character
getline(cin, songVerse);
// Modify songVerse to replace (Name) with userName without first character
/* Your solution goes here */
cout << songVerse << endl;
return 0;}
Please help me with this string operations problem using C++.
arrow_forward
JAVA PPROGRAM ASAP
Please Modify this program ASAP BECAUSE IT IS HOMEWORK ASSIGNMENT so it passes all the test cases.
The program must pass the test case when uploaded to Hypergrade. Also, for test cases 1-4 it wants only to input Please enter the file name or type QUIT to exit: then input the file and display the Total number of words. For test cases 5 and 7 it wants to only to input Please enter the file name or type QUIT to exit then input input5.txt and then display File: input5.txt does not exist.\n then display Please enter the file name again or type QUIT to exit:\n then type input1.txt to display the total number of words or type quit to exit the program. For test case 6 it wants only to Please enter the file name again or type QUIT to exit:\n then type quit to exit the porgram.
Chapter 9. PC #10. Word Counter (page 610)
Write a program that asks the user for the name of a file. The program should display the number of words that the file contains.
Input…
arrow_forward
In java, without Arrays and using only String methods ( don't use String builder)
// Question 17: In MS-DOS, a file name consists of up
// to 8 characters (excluding '.', ':', backslask, '?',
// and '*'), followed by an optional dot ('.' character)
// and extension. The extension may contain zero to three
// characters. For example, 1STFILE.TXT is a valid filename.
// Filenames are case-blind.
//
// Write and test a method that takes
// in a String, validates it as a valid MS-DOS file
// name, appends the extensions ".TXT" if no extension
// is given (that is, no '.' appears in FILENAME), converts
// the name to uppercase, and returns the resulting string
// to the calling method
// If fileName ends with a dot, remove that dot and do not
// append the default extension. If the name is invalid,
// validFileName should return null.
public String validFileName(String n)
{
}
arrow_forward
Each of the following files in the Chapter.01 folder of your downloadable student files has syntax and/or logical errors. In each case, determine the problem and fix the program. After you correct the errors, save each file using the same filename preceded with Fixed. For example, DebugOne1.cs will become FixedDebugOne1 .cs. a. DebugOne1.cs b. DebugOne2.cs c. DebugOne3.cs d. DebugOne4.cs
arrow_forward
Each of the following files in the Chapter.07 folder of your downloadable student files has syntax and/or logical errors. In each case, determine the problem, and fix the program. After you correct the errors, save each file using the same filename preceded with Fixed. For example, DebugSeven1.cs will become FixedDebugSeven1.cs. a. DebugSeven1.cs b. DebugSeven2.cs c. DebugSeven3.cs d. DebugSeven4.cs
arrow_forward
d) Create a new Java file in Eclipse. Perform the following operations:
Create a new StringBuilder from the String "Prepare for your knowledge".
Check the capacity of the StringBuilder if it's empty.
Find the index of the letter 'y'.
Delete a substring from the starting index till this index (of ‘y’).
Insert a string "Good luck on " at the beginning of the StringBuilder.
Append '!' to it.
Print your StringBuilder to Console.
Attach the screenshot of code and output.
arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you

EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT

Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,

EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT

EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT

Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,

EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT