SlideShare ist ein Scribd-Unternehmen logo
1 von 1
Create a package called homeWork2. This is a simple program
CSC 230: Elementary Data Structures and AlgorithmsAssignment:Create a package called
homeWork2. This is a simple program that has only the one main class.The program will
have two parts to it (but it is all in one program). This program has you reading two files
and writing to one file. You may choose whichever processes you wish to use to read the
two files, but they must be different. You may choose how you wish to write the file. The
files you will be reading will be text files. The file you will write to will be writing an array
list.The output shown on the screen and in the file must be readable.The program must
have error checking. In the main method, you will add a try-with-resourcesexception. Feel
free to use the Java exception catch and/or to write your own messages.Part 1: Reading the
file called bakebread.txtIn the first part of the program, under the programmer and
program information, you will ask a user to enter the name of the file to be opened. You will
then test to see of the filename that was entered by the user is valid. If it is invalid, you will
let the user reenter the filename. Once you have the correct name entered, you will be able
to read the file.The exists() method is most helpful.The program will then print out the
sentences that show the program information that will be the size of the file in bytes and the
absolute path to the file.You will then be able to ask the user which word he or she wishes
to find in the file. Your program will then check to see if the word is in the file. If it is not, the
program will say so. If the file does contain the word, the program will say how many times
the word shows up in the file.You will add a try to this part of the program before reading
the contents of the file. Although you do not need to explicitly close the bakebread.txt file
due to the try with resources, I would like you to do so, please. Under it, write the matching
catch for the try you have.

Weitere ähnliche Inhalte

Ähnlich wie Create a package called This is a simple program.docx

cs3157-summer06-lab1
cs3157-summer06-lab1cs3157-summer06-lab1
cs3157-summer06-lab1tutorialsruby
 
cs3157-summer06-lab1
cs3157-summer06-lab1cs3157-summer06-lab1
cs3157-summer06-lab1tutorialsruby
 
Write a program that asks the user for the name of a file. The progr.pdf
Write a program that asks the user for the name of a file. The progr.pdfWrite a program that asks the user for the name of a file. The progr.pdf
Write a program that asks the user for the name of a file. The progr.pdfarri2009av
 
CSCI  132  Practical  Unix  and  Programming   .docx
CSCI  132  Practical  Unix  and  Programming   .docxCSCI  132  Practical  Unix  and  Programming   .docx
CSCI  132  Practical  Unix  and  Programming   .docxmydrynan
 
lecture2-PerlProgramming
lecture2-PerlProgramminglecture2-PerlProgramming
lecture2-PerlProgrammingtutorialsruby
 
lecture2-PerlProgramming
lecture2-PerlProgramminglecture2-PerlProgramming
lecture2-PerlProgrammingtutorialsruby
 
File handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reuge
File handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reugeFile handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reuge
File handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reugevsol7206
 
Hello guys please make sure program runs well USING C anyth.pdf
Hello guys please make sure program runs well USING C anyth.pdfHello guys please make sure program runs well USING C anyth.pdf
Hello guys please make sure program runs well USING C anyth.pdfactioncbe1
 

Ähnlich wie Create a package called This is a simple program.docx (20)

Filesin c++
Filesin c++Filesin c++
Filesin c++
 
cs3157-summer06-lab1
cs3157-summer06-lab1cs3157-summer06-lab1
cs3157-summer06-lab1
 
cs3157-summer06-lab1
cs3157-summer06-lab1cs3157-summer06-lab1
cs3157-summer06-lab1
 
Java ant tutorial
Java ant tutorialJava ant tutorial
Java ant tutorial
 
Ant tutorial
Ant tutorialAnt tutorial
Ant tutorial
 
Write a program that asks the user for the name of a file. The progr.pdf
Write a program that asks the user for the name of a file. The progr.pdfWrite a program that asks the user for the name of a file. The progr.pdf
Write a program that asks the user for the name of a file. The progr.pdf
 
How java works
How java worksHow java works
How java works
 
How java works
How java worksHow java works
How java works
 
Chapter - 5.pptx
Chapter - 5.pptxChapter - 5.pptx
Chapter - 5.pptx
 
CSCI  132  Practical  Unix  and  Programming   .docx
CSCI  132  Practical  Unix  and  Programming   .docxCSCI  132  Practical  Unix  and  Programming   .docx
CSCI  132  Practical  Unix  and  Programming   .docx
 
lecture2-PerlProgramming
lecture2-PerlProgramminglecture2-PerlProgramming
lecture2-PerlProgramming
 
lecture2-PerlProgramming
lecture2-PerlProgramminglecture2-PerlProgramming
lecture2-PerlProgramming
 
Qtp launch
Qtp launchQtp launch
Qtp launch
 
Chapter 11
Chapter 11Chapter 11
Chapter 11
 
Filepointers1 1215104829397318-9
Filepointers1 1215104829397318-9Filepointers1 1215104829397318-9
Filepointers1 1215104829397318-9
 
File handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reuge
File handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reugeFile handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reuge
File handling3 (1).pdf uhgipughserigrfiogrehpiuhnfi;reuge
 
File Handling
File HandlingFile Handling
File Handling
 
File Handling
File HandlingFile Handling
File Handling
 
Hello guys please make sure program runs well USING C anyth.pdf
Hello guys please make sure program runs well USING C anyth.pdfHello guys please make sure program runs well USING C anyth.pdf
Hello guys please make sure program runs well USING C anyth.pdf
 
Chapter 08 data file handling
Chapter 08 data file handlingChapter 08 data file handling
Chapter 08 data file handling
 

Mehr von sdfghj21

you interviewed the CEO and evaluated the organization to gain.docx
you interviewed the CEO and evaluated the organization to gain.docxyou interviewed the CEO and evaluated the organization to gain.docx
you interviewed the CEO and evaluated the organization to gain.docxsdfghj21
 
Write a to paper about genetically vigorous.docx
Write a to paper about genetically vigorous.docxWrite a to paper about genetically vigorous.docx
Write a to paper about genetically vigorous.docxsdfghj21
 
When you talk about the meaning of which sense.docx
When you talk about the meaning of which sense.docxWhen you talk about the meaning of which sense.docx
When you talk about the meaning of which sense.docxsdfghj21
 
Virtualization and cloud services continue to gain momentum as more.docx
Virtualization and cloud services continue to gain momentum as more.docxVirtualization and cloud services continue to gain momentum as more.docx
Virtualization and cloud services continue to gain momentum as more.docxsdfghj21
 
Your name Brief background Your profession What you hope to.docx
Your name Brief background Your profession What you hope to.docxYour name Brief background Your profession What you hope to.docx
Your name Brief background Your profession What you hope to.docxsdfghj21
 
The ways in which views related to race seem.docx
The ways in which views related to race seem.docxThe ways in which views related to race seem.docx
The ways in which views related to race seem.docxsdfghj21
 
This project provides you an opportunity to apply the marketing.docx
This project provides you an opportunity to apply the marketing.docxThis project provides you an opportunity to apply the marketing.docx
This project provides you an opportunity to apply the marketing.docxsdfghj21
 
The assignment must be submitted on a Microsoft word.docx
The assignment must be submitted on a Microsoft word.docxThe assignment must be submitted on a Microsoft word.docx
The assignment must be submitted on a Microsoft word.docxsdfghj21
 
Using online or library research articles explain the.docx
Using online or library research articles explain the.docxUsing online or library research articles explain the.docx
Using online or library research articles explain the.docxsdfghj21
 
Standards are designed to ensure Without no structure.docx
Standards are designed to ensure Without no structure.docxStandards are designed to ensure Without no structure.docx
Standards are designed to ensure Without no structure.docxsdfghj21
 
think of a leader or presenter whose communication has.docx
think of a leader or presenter whose communication has.docxthink of a leader or presenter whose communication has.docx
think of a leader or presenter whose communication has.docxsdfghj21
 
The Community of Inquiry frameworkLinks to an external is.docx
The Community of Inquiry frameworkLinks to an external is.docxThe Community of Inquiry frameworkLinks to an external is.docx
The Community of Inquiry frameworkLinks to an external is.docxsdfghj21
 
we focus on notion of the in addition.docx
we focus on notion of the in addition.docxwe focus on notion of the in addition.docx
we focus on notion of the in addition.docxsdfghj21
 
When and how did you become aware of people being.docx
When and how did you become aware of people being.docxWhen and how did you become aware of people being.docx
When and how did you become aware of people being.docxsdfghj21
 
To Working with your field identify a social.docx
To Working with your field identify a social.docxTo Working with your field identify a social.docx
To Working with your field identify a social.docxsdfghj21
 
Write Cornell notes after reading Cornell Notes are.docx
Write Cornell notes after reading Cornell Notes are.docxWrite Cornell notes after reading Cornell Notes are.docx
Write Cornell notes after reading Cornell Notes are.docxsdfghj21
 
What are some current challenges your chosen groups.docx
What are some current challenges your chosen groups.docxWhat are some current challenges your chosen groups.docx
What are some current challenges your chosen groups.docxsdfghj21
 
To complete this review the Learning Resources for this.docx
To complete this review the Learning Resources for this.docxTo complete this review the Learning Resources for this.docx
To complete this review the Learning Resources for this.docxsdfghj21
 
summarize Jacob and inspirations in a.docx
summarize Jacob and inspirations in a.docxsummarize Jacob and inspirations in a.docx
summarize Jacob and inspirations in a.docxsdfghj21
 
Strong leaders do not only focus on building their own.docx
Strong leaders do not only focus on building their own.docxStrong leaders do not only focus on building their own.docx
Strong leaders do not only focus on building their own.docxsdfghj21
 

Mehr von sdfghj21 (20)

you interviewed the CEO and evaluated the organization to gain.docx
you interviewed the CEO and evaluated the organization to gain.docxyou interviewed the CEO and evaluated the organization to gain.docx
you interviewed the CEO and evaluated the organization to gain.docx
 
Write a to paper about genetically vigorous.docx
Write a to paper about genetically vigorous.docxWrite a to paper about genetically vigorous.docx
Write a to paper about genetically vigorous.docx
 
When you talk about the meaning of which sense.docx
When you talk about the meaning of which sense.docxWhen you talk about the meaning of which sense.docx
When you talk about the meaning of which sense.docx
 
Virtualization and cloud services continue to gain momentum as more.docx
Virtualization and cloud services continue to gain momentum as more.docxVirtualization and cloud services continue to gain momentum as more.docx
Virtualization and cloud services continue to gain momentum as more.docx
 
Your name Brief background Your profession What you hope to.docx
Your name Brief background Your profession What you hope to.docxYour name Brief background Your profession What you hope to.docx
Your name Brief background Your profession What you hope to.docx
 
The ways in which views related to race seem.docx
The ways in which views related to race seem.docxThe ways in which views related to race seem.docx
The ways in which views related to race seem.docx
 
This project provides you an opportunity to apply the marketing.docx
This project provides you an opportunity to apply the marketing.docxThis project provides you an opportunity to apply the marketing.docx
This project provides you an opportunity to apply the marketing.docx
 
The assignment must be submitted on a Microsoft word.docx
The assignment must be submitted on a Microsoft word.docxThe assignment must be submitted on a Microsoft word.docx
The assignment must be submitted on a Microsoft word.docx
 
Using online or library research articles explain the.docx
Using online or library research articles explain the.docxUsing online or library research articles explain the.docx
Using online or library research articles explain the.docx
 
Standards are designed to ensure Without no structure.docx
Standards are designed to ensure Without no structure.docxStandards are designed to ensure Without no structure.docx
Standards are designed to ensure Without no structure.docx
 
think of a leader or presenter whose communication has.docx
think of a leader or presenter whose communication has.docxthink of a leader or presenter whose communication has.docx
think of a leader or presenter whose communication has.docx
 
The Community of Inquiry frameworkLinks to an external is.docx
The Community of Inquiry frameworkLinks to an external is.docxThe Community of Inquiry frameworkLinks to an external is.docx
The Community of Inquiry frameworkLinks to an external is.docx
 
we focus on notion of the in addition.docx
we focus on notion of the in addition.docxwe focus on notion of the in addition.docx
we focus on notion of the in addition.docx
 
When and how did you become aware of people being.docx
When and how did you become aware of people being.docxWhen and how did you become aware of people being.docx
When and how did you become aware of people being.docx
 
To Working with your field identify a social.docx
To Working with your field identify a social.docxTo Working with your field identify a social.docx
To Working with your field identify a social.docx
 
Write Cornell notes after reading Cornell Notes are.docx
Write Cornell notes after reading Cornell Notes are.docxWrite Cornell notes after reading Cornell Notes are.docx
Write Cornell notes after reading Cornell Notes are.docx
 
What are some current challenges your chosen groups.docx
What are some current challenges your chosen groups.docxWhat are some current challenges your chosen groups.docx
What are some current challenges your chosen groups.docx
 
To complete this review the Learning Resources for this.docx
To complete this review the Learning Resources for this.docxTo complete this review the Learning Resources for this.docx
To complete this review the Learning Resources for this.docx
 
summarize Jacob and inspirations in a.docx
summarize Jacob and inspirations in a.docxsummarize Jacob and inspirations in a.docx
summarize Jacob and inspirations in a.docx
 
Strong leaders do not only focus on building their own.docx
Strong leaders do not only focus on building their own.docxStrong leaders do not only focus on building their own.docx
Strong leaders do not only focus on building their own.docx
 

Kürzlich hochgeladen

How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 

Kürzlich hochgeladen (20)

How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 

Create a package called This is a simple program.docx

  • 1. Create a package called homeWork2. This is a simple program CSC 230: Elementary Data Structures and AlgorithmsAssignment:Create a package called homeWork2. This is a simple program that has only the one main class.The program will have two parts to it (but it is all in one program). This program has you reading two files and writing to one file. You may choose whichever processes you wish to use to read the two files, but they must be different. You may choose how you wish to write the file. The files you will be reading will be text files. The file you will write to will be writing an array list.The output shown on the screen and in the file must be readable.The program must have error checking. In the main method, you will add a try-with-resourcesexception. Feel free to use the Java exception catch and/or to write your own messages.Part 1: Reading the file called bakebread.txtIn the first part of the program, under the programmer and program information, you will ask a user to enter the name of the file to be opened. You will then test to see of the filename that was entered by the user is valid. If it is invalid, you will let the user reenter the filename. Once you have the correct name entered, you will be able to read the file.The exists() method is most helpful.The program will then print out the sentences that show the program information that will be the size of the file in bytes and the absolute path to the file.You will then be able to ask the user which word he or she wishes to find in the file. Your program will then check to see if the word is in the file. If it is not, the program will say so. If the file does contain the word, the program will say how many times the word shows up in the file.You will add a try to this part of the program before reading the contents of the file. Although you do not need to explicitly close the bakebread.txt file due to the try with resources, I would like you to do so, please. Under it, write the matching catch for the try you have.