Wооhоo! You've completed the Anth 203 Midterm 2 Exаm.
Write the cоde fоr а public stаtic methоd nаmed countWords. The method receives a File and returns the total number of words in the file as an int. Words are separated by a single space, and there may be multiple words per line. If the file does not exist, the code should print "File does not exist" on its own line before returning 0. Do not handle any other exceptions that might come about; let them propagate. You may assume the file contains at least one word. You must use exception handling code. You may not use File's exists() method. Be sure to close every object that should be closed before returning. You do not need to write import statements or wrap your method in a class. Canvas Tip for all Qs: Click on the dropdown that says "Paragraph" and switch to "Preformatted" to get a monospaced font - this can help in coding answers