首页 > > 详细

讲解program编程语言、辅导Python程序、讲解Python设计编程 讲解数据库SQL|解析C/C++编程

项目预算:   开发周期:  发布时间:   要求地区:
load
Load a file of movie titles. Prompt for the name of a file. If no name is
input (e.g. if using input() and the user presses the enter key), load from
"movies.txt", otherwise load it from the specified filename.
The file of movie titles is a text file is formatted with one movie per
line.
random Randomly pick a movie title and display it.
search
Prompt for a string, and then search for and display all movies that contain
this string Search case-independently, and separate the movies with a blank
line. If the search string is empty, exit the search and redisplay the menu.
Once this is going, modify search to prompt for two strings. If you enter an
empty string when prompted for the second string, it just searches for a
single string, as before, but if the second string is non-empty, it only displays
movies that contain both strings.
starts
with
Prompt for a string and then search for and display all movies that start with
this string. Search case-independently, and separate movies with a blank
line. If the search string is empty, exit the starts with search and redisplay the
menu.
keep Add the last displayed movie to a list of your favourites.
favourites Display the current favourites list.
clear Clear the favourites list.
quit Quit the program.
Assignment 2: A Movie Title Explorer
There's a file of the top 1000 or so movie titles called movies.txt. For this question you're to build
a way of displaying a random movie title, finding movies, and building and saving a list of movies
you would like to watch.
The program first displays a menu (something like that shown below) and carries out the
appropriate action depending on which letter the user types, and then redisplays the menu:
You should have a function for each of the commands below, except for Quit.
The valid commands are:
*** Movie Title Explorer ***
l – load file of movie titles
r – random movie
s – search
sw – starts with
k – keep - save the last displayed movie title to your favourites
f – favourites display
c – clear favourites
q – quit
command: ?
Don't forget to add appropriate checks. e.g. to make sure the file of movies has been loaded.
IMPORTANT: make sure that you use functions. Many of the commands could be in hteir own
function.
What and how to submit How:
What: Submit your Python program, each named with.py extension.
Do not submit Word documents (.doc or .docx) or .zip files.
Check that:
all programs should display your name,ID number and your classname when starting.
that your files have a .py extension

软件开发、广告设计客服
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 9951568
© 2021 www.rj363.com
软件定制开发网!