Write this program using Python: You are creating a program that opens and reads a file. Your program opens a file that

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Write this program using Python: You are creating a program that opens and reads a file. Your program opens a file that

Post by answerhappygod »

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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply