Write this program using Python: You are creating a program that opens and reads a file. Your program opens a file that
Posted: Fri May 20, 2022 3:42 pm
Write this program using Python:
You are creating a program that opens and reads a file. Your
program opens a file that is named Moby Dick.txt. The file is
located in the Files/Datafiles/FinalExam directory. Your program
will display a menu that allows a user to choose how to process the
file. Download the input file Moby Dick.txt from Files.
write a program that: Opens a file.
Prompts a user with a menu of choices.
The user makes a choice. If one is chosen - the program counts
the number of words in the novel. If two are chosen - the program
prompts a word to search for. It returns the number of instances of
that word. if three is chosen - the program returns a secret
message that is embedded in the file delimited by @s. if four is
chosen, close the output file, and the program exits. The menu will
continue to display as long as four is not entered.
Define a function called display_menu() that displays a menu and
returns the option chosen. Define a function called
get_word_count() resets handle_input reads every record in the file
counts every word in the record adds count to a total count returns
the total count Define a function called get_specific_count()
resets handle_input reads every record in the file looks to match
the word and counts the matches Define a function called
find_message() resets handle_input finds a message embedded between
2 @s
You are creating a program that opens and reads a file. Your
program opens a file that is named Moby Dick.txt. The file is
located in the Files/Datafiles/FinalExam directory. Your program
will display a menu that allows a user to choose how to process the
file. Download the input file Moby Dick.txt from Files.
write a program that: Opens a file.
Prompts a user with a menu of choices.
The user makes a choice. If one is chosen - the program counts
the number of words in the novel. If two are chosen - the program
prompts a word to search for. It returns the number of instances of
that word. if three is chosen - the program returns a secret
message that is embedded in the file delimited by @s. if four is
chosen, close the output file, and the program exits. The menu will
continue to display as long as four is not entered.
Define a function called display_menu() that displays a menu and
returns the option chosen. Define a function called
get_word_count() resets handle_input reads every record in the file
counts every word in the record adds count to a total count returns
the total count Define a function called get_specific_count()
resets handle_input reads every record in the file looks to match
the word and counts the matches Define a function called
find_message() resets handle_input finds a message embedded between
2 @s