Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

To feel good about programming, one should really develop a program that is interesting enough to feel good about. Here are some recommended choices for

To feel good about programming, one should really develop a program that is interesting enough to feel good about. Here are some recommended choices for a program to turn in at the end of the semester. The intent here is not to intimidate you about the course demands, but to provide a focal point for your mental energies throughout the term.

Only one project is required per student. You do not need to turn in all three.

A simple quiz

A file will consist of a series of questions and answers, something like this:

This will ask for the capitals of several countries. What is the capital of France?,Paris What is the capital of Egypt?,Cairo 

The program will read the contents of the file and then quiz the user:

What is the name of the question file? capitals This will ask for the capitals of several countries. What is the capital of Japan? Tokyo Correct! What is the capital of Peru? Lima Correct! What is the capital of Assyria? I don't know that! Incorrect! The answer is Nineveh You got 2 answers correct out of 3, which is 67% 

At least 10 questions should be asked out of a question bank of at least 15. Questions should be chosen at random from the collection, without repeating.

A simple Madlib

A file will contain a series of text and prompts for additional words, something like this:

T,Your P,a relative T,was a P,a pet animal T and your P,another relative T,smelt of P,fruits (plural) 

A user will be asked for items to fill in the blanks and then the resulting text will be displayed. The output must be reasonably well displayed, with some degree of relevant word wrap.

What is the name of the Madlib file? insults Please supply words for the following prompts: a relative: mother a pet animal: hamster another relative: father fruits (plural): elderberries Your mother was a hamster and your father smelt of elderberries! 

There should be at least 10 prompts and enough text to assure that the resulting paragraph spans to at least three lines of output.

Hangman

A file will contain a list of candidate words, and one will be chosen at random. The user is then prompted for letters to guess. Correct guesses will be placed in the corresponding blanks; there is a limit to how many incorrect guesses are allowed.

An input file might look something like this:

person,lumberjack place,camelot phrase,my hovercraft is full of eels 

Here is a sample interface:

What file will the words come from? hangman This one is looking for a phrase: ______ ____ __ ___ ______ ____ __ ____ What is your guess? e There are 3 e's ______ ____ __ __e ______ ___e __ ___e What is your guess? a There are 2 a's a__a__ ____ __ __e ______ ___e __ ___e What is your guess? s There are 2 s's a__a_s ____ __ __e ______ s__e __ ___e What is your guess? i There are 3 i's a__a_s ____ __ __e __i___ si_e __ _i_e What is your guess? z There are no z's (1 incorrect guess) What is your guess? There are 4 o's a__a_s _oo_ o_ __e __i___ si_e o_ _i_e 

It would be very appropriate to have one execution of the program to allow a user to try to guess at more than one entry in the file.

Using Ascii art to sketch out the hanging man would be an interesting feature, but the more challenging part of the program is the game itself.

Other proposals

Alternatively, you can come up with a project of your own, comparable to those listed above. Your proposal must meet this requirements:

It must obtain some data from a file

There must be appropriate call for either lists or dictionaries

There must be appropriate call for decisions and repetitions

The project must be large enough to merit decomposing into functions

The problem may not have been assigned for any other Python course

The solution may not have come from or derived from any other source

The proposal must be approved by the instructor before 31 October.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions

Question

proof sum of energy in pipe network loop is equal to zero

Answered: 1 week ago