Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Bartleby Related Questions Icon
Related questions
Question
Can someone please help me with this project for my Java
Transcribed Image Text:Main.java X
1 package HP6_taylor;
2
30 import java.io.BufferedReader;
4 import java.io.FileReader;
5 import java.io.FileWriter;
6 import java.io.I0Exception;
7
8 public class Main {
9.
public static void main(String[] args) {
// TODO Auto-generated method stub
readwrite("words_for_homework(1).txt", "words_for_homework(1)Out.text");
}
public static void readwrite(String infile, String outfile) {
FileReader reader = null;
FileWriter writer = null;
try {
100
11
12
140
15
16
17
reader = new FileReader(infile);
writer = new FileWriter(outfile);
18
19
20
BufferedReader bufferedReader = new BufferedReader(reader);
String line;
while ((line = bufferedReader.readLine()) != null)
{
if (line.length() > 4)
{
21
22
23
24
25
26
27
if (line.substring(line.length()
4, line.length()).equalsIgnoreCase("dous"))
28
writer.write(line + '\n');
}
}
reader.close();
writer.close();
29
31
32
33
}
34
catch (I0Exception e){
e.printStackTrace();
35
36
37
38
O39 }
40
Problems
@ Javadoc E Declaration
Console X
<terminated> Main [Java Application] /Volumes/Eclipse/Eclipse.app/Contents/Eclipse/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.macosx.x86
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at HP6_taylor.Main.main(Main.java:10)
N m st LO LO N
Transcribed Image Text:The following is an old word puzzle: "Name a common word, besides tremendous, stupendous and horrendous, that ends in dous."
We can also solve this puzzle by reading a text file of English words and outputting the word if it contains "dous" at the end. The text file
"words_for_homework.txt" contains 87314 English words, including the word that completes the puzzle.
Write a program that reads each word from the attached text file (words_for_homework.txt) and writes only those containing "dous" at the
end to another file. Below is a hint at the code to get at the dous. Include exception handling to catch any errors with the files. Use the
finally block to close the files. Zip the project folder and upload here.
Code Hint for -dous:
String line
br.readLine();
%3D
while (line != null)
{
if (line.length() > 4)
{
if (line.substring(line.length() - 4, line.length()).equalsIgnoreCase("dous"))
{
fw.write(line + "\n");
}
}
line = br.readLine();
}
Expert Solution
Check MarkThis question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
bartleby
This is a popular solution
bartleby
Trending nowThis is a popular solution!
bartleby
Step by stepSolved in 2 steps with 1 images
Knowledge Booster
Background pattern image
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Find a way to increase the value of X by 10 while processing a game object in JavaScript?arrow_forwardHow could I resize an image on Java. I'm using JGRASParrow_forwardSince I'm interested in picking up some Python, it would be really helpful if you could point me in the right path and give me some specific advice.arrow_forward
- Give examples of five particular methods you may use to make your writing better.arrow_forwardDiscuss the Sierpinski Gasket and run the appropriate program/code in Java to produce said gasket. Please and thank you... Also if its not too much to ask can you please include comments as to what each section of code is doing/give an understanding. It helps me in my learning.arrow_forwardCreate a Rock Paper Sissors game using Java Swingarrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Text book imageDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationText book imageStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONText book imageDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- Text book imageC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONText book imageDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningText book imageProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education