Demonstrate your ability to apply fundamental programming concepts that we have covered throughout the semester to write a program.
Write a program given a general outline following basic design
Recognize and extract a function from existing requirements to simplify the
Define functions with docStrings that list the description, input, and
Overview and Project Layout
The final project builds a word jumble game. The game will present a jumbled word to the player. The main objective of the game is for the player to simply unscramble the word and type it in for evaluation. The player types in a guess until the word is successfully unscrambled, at which point the player is congratulated and they are asked if they would like to play again. If, at any point, the player no longer wishes to play, they may hit enter at the prompt to quit the game.
The project divides into three parts (Part I is described in the paragraph above). Part 1 is worth 79 points. Part 2 is worth 10 points, and Part 3 is worth 11 points. You are not required to complete Parts 2 and 3, but your overall grade will still be out of 100 points. For example, if you complete only Part 1, then the maximum grade you can earn is 79 out of 100 points. Similarly, if you complete through part 2, the maximum grade you could potentially earn is 89/100 points.
Part 2 will be more challenging than Part 1, and in turn Part 3 will be more challenging than Part 2, mainly being that less detailed instructions are provided and require you to demonstrate a deeper understanding of the course objectives. Part 2 will not be graded if you do not earn 70 of the 79 points on Part 1. Part 3 will not be graded if you earn less than 7 of the 10 possible points on Part 2.
The specifications are given for each part below. Each part builds on the previous part. Do not move onto the next part until you have successfully completed ALL requirements from the previous part.
You are able to seek help from the csX tutors for Part 1 only. TA's have been instructed to correct syntax errors and help with explaining and correcting runtime If you have a question about how to implement a given task, the TA's are instructed to refer you to a related chapter in the book and/or discuss a lab that dealt with similar material. Do not seek their help on Parts 2 and 3.
Do not discuss the project with anyone other than the csX tutors or your I run all project submissions through a plagiarism detection service.
You may only seek help/ask questions from your instructor for Parts 2 and 3 of the
The format of the code is very important. Please do not mix program code and function definitions. It is a requirement that your code file be organized into the following sections:
Function definitions – all functions must have docStrings. Every docString must have a description, any input requirements or @input none if no input is required, and @return stating what the output value is or none if the function does not have an
Program code – of which there will only be one line of code that falls into this
Additionally, name your variables and functions appropriately. By this I mean, give obvious names. For example, if your variable is pointing to a grade value, then call it a_grade, not character. Additionally, function names usually are stated as an action or a verb – e.g. calculate_grade; and variables are typically stated as nouns – e.g. a_grade, size.
All code will go into a single python file in part I; part III is optional if you would like to include external files. Please name your file according to the following convention: firstname_lastname_finalProject.py, where firstname and lastname are you actual first and last names.
There is no starter file or additional module files for this assignment, however, you are free to use your lab exercises as examples. If you have any questions about the solutions to previous labs, please come and talk to me. I will be happy to go over them with you.
Here are some hints to get you started. Please keep in mind that the code referenced here are examples and you will use similar code in your project.
Getting a random word from the list. The random module provides methods that enable us to easily get a random element from a non-empty sequence/list. Reference the random module documentation for an appropriate function. In the case of this game, the list will be a list of words to scramble and Usage of this method is very similar to the random.randrange function from assignment 2.
List slices review. Please remember the following about list slices: the start value is included in the range; the stop value is not. Consider the following:
fullname = “A|n|a| |P|e|r|a|l|t|a”
(index 0|1|2|3|4|5|6|7|8|9|10) # These are the index values of the characters in the string.
space_position = 3 # index value of the space in the fullname variable value.
f_name = name[ : space_position] # f_name has the value ‘Ana’; up to but does not include 3
l_name = name[ space_position + 1 : ]# l_name has the value ‘Peralta’; from position 4 to end
Note that the space in the name has been ‘deleted’.
The following page contains detailed instructions on the requirements for the assignment. There is nothing unexpected or tricky about this assignment. It is a way for me to evaluate your understanding of the concepts presented in this course. If you have any questions, you can seek help from the csX lab or from myself. You may not ask fellow classmates, CS majors outside of the csX lab, or any other CS professional(s) for help on this project.
Please remember to do your own work and not to discuss the implementation detail (i.e. how you wrote your code) of your assignment with anyone. If you are working in the lab or other public space, be aware of those beside you who may have wandering eyes. Furthermore, do not leave your work on any public computers. If someone is borrowing your computer, make sure that your assignment is not on the machine. Do not give your code to anyone else, even if they promise not to copy it. Any work flagged by the plagiarism software will be awarded a zero and all incidents will also be reported to the Office of Student Affairs so that they can determine if further disciplinary action is warranted. Please keep in mind that this is 20% of your final grade in this class. A zero on this project will drop your grade a minimum of 2 letter grades.
Part I: Program Structure
The project breaks down into two basic steps listed below. In the following section, there will be more requirements listed in order to implement the functionality.
Play a game
Scramble chosen word
Scramble the Chosen Word
Define a function to scramble the word chosen.
The function requires one input representing the chosen
Use a local variable to hold the jumbled The initial value should be an empty string.
Use a loop create your jumbled word one letter at a time; continue looping while the word is not an empty (In the body of the loop, you will write code that will take away one letter at a time.)
Get a random letter from the word by generating a random position/index in the word to Hint: The upper bound of the randrange function is the length of the word to scramble.
Update the jumbled word by adding the random letter to the jumbled
Create a new version of the word minus the one letter at the random position Hint: Use the slice operator to divide the word into two halves; the randomly chosen letter divides the word.
The first slice, is every letter up to, but not including word[position] (where word and position are variables in my )
The second slice starts at the letter after word[position] and goes to the end of the I gave you some hints under the Special Notes.
Update word by adding the two first and second slices back This is where you will ‘take away’ the letter you just added to the jumbled word.
Return the jumbled
Test your code. Verify the function by calling the function and verifying that a scrambled version is returned.
DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma
Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t
Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th
1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of
1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of