Create a program that calculates estimates on how long it would take a user to re-type a book.
Ask the user for the name of a book to read in. This is the book that the user wants to re-type. Choose a book from Project Gutenberg, or make a small text file by hand. Filenames will be for files that are in the same directory as your program. You can assume the user provides a valid filename of a text file that is in the same directory. Choose a random line from the book for the use to type. The line that is chosen MUST have at least 10 characters on it. Ask the user to re-type the random line from the book Give some statistics about the book: How many words and characters are there in the book What is the average word length? What is the average length of each line in the book? How many blank lines are in the book? Calculate some estimates: Given how many words per minute the user provided, calculate how many hours it would take to re-type the book that was provided Given how many characters per minute the user provided, calculate how many hours it would take to re-type the book. Print out how long it would take to re-create the book in both minutes, and hours. Print out all decimal values to with 2 decimal places.
Aucun commentaire:
Enregistrer un commentaire