CS151 PROGRAMMING ASSIGNMENT 2 solution

$25.00

Original Work ?

Download Details:

  • Name: Programming-Assignment-2-Code-dny3bv.zip
  • Type: zip
  • Size: 7.08 KB

Category: You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

Description

5/5 - (1 vote)

I. PROBLEM:

You are creating a text adventure game! In this game, the user gives input that affects the path of the story. You must create a game that meets the requirements in the specification below.

II. PURPOSE OF THE ASSIGNMENT

The purpose of this assignment is to give you
1. practice with input & output
2. the opportunity to use decision making
3. a chance to be creative

III. REQUIREMENTS ANALYSIS

The first stage in your programming assignment is the requirements analysis stage. You need to make sure you understand the below requirements for what needs to be included in your story’s decision making:

1. Your adventure game must ask the user at least 1 question using each of the following types:
1. Make a decision based on the value of an integer input.
2. Make a decision based on the value of a float input.
3. Make a decision based on the value of a string input.

2. Your adventure game must have a path with at least 2 decisions on it (e.g. I am given the option of choosing A or B. I make choice A which then lets me decide between X and Y; but if I choose B I do not get to choose between X and Y, but instead do something else).

3. Your adventure game must have at least 1 choice that has at least 3 possible directions (for example, when they enter a number the game takes a different path if their number is <5, between 5 and 10, or > 10).

4. Your adventure game must use at least 3 different boolean operators throughout the story.
5. Your adventure game must have a decision where it gives the user at least two specific inputs to choose from, and does something different based on which value they input (e.g. “enter ‘green’, ‘red’, or ‘yellow'”).

6. Your adventure game must use something the user input in part of the output at least once (e.g., asking for their name and then outputting their name every time you address them).

The game must make sense and have an actual story to it. It needs to be understandable. Consider that your professor will be reading the entire story.

Your game should also not just use the exact examples used above.

An Example Game

Please watch the [youtube video showing an example game](https://www.youtube.com/watch?v=x0Ksedq3Z5k). It does not show all of the requirements from above, but does demonstrate a number of them. If you are having trouble understanding what is being asked of you in this assignment, be sure to watch the video.

 IV. DESIGN

The second stage is to design your solution based on the requirements:

1. Write out your algorithm, including input, output, decisions, and calculations.
1. Be sure to indent and properly number to show when a decision is nested inside another decision.

2. If you have story elements that are used in multiple paths, you can label them as “story part 1,” “story part 2,” etc., and then reference them by that name the next time it’s used, instead of writing it all out again. However you must give your full story as part of your design. Don’t write your entire algorithm by just saying “story part X.”

2. Double check that you included all of the requirements

If you are having trouble coming up with a story, think about a book or movie you enjoyed. Be inspired by its story line or characters and come up with something original.

DESIGN SUBMISSION: 9/28/22

Submit to GitHub in PA2 repository: the algorithm for your adventure game in designInitial.txt.

*Remember to double check on github.com that your file pushed. If it didn’t, you need to push it. Your instructor can only see what is on github.com, not what is only on your computer.*

Your algorithm should follow the requirements of an algorithm, contain all of the requirements, and include your entire story. Everything should be planned out. There should not be any code.

V. PROGRAMMING REQUIREMENTS

After your design is complete and correct, it’s time to start programming and then testing:

1. Fix design issues: If there were issues with your design, either not meeting requirements or in the format, fix that before you start writing your code.
2. Implementation: Write your program following the requirements and based on your design.

1. Follow good usability/HCI principles in your input and output (for instance, make it clear the type of input you are asking for).
2. Remember to state the purpose of the program.
3. Testing: Make sure it works correctly; give it sample input, and check that the output is correct.

1. Create a flowchart, label the control paths, and list a test case for each control path. Test that you can get through each path correctly. You do not need to put the full output in the flowchart, just make it clear what part of the output is there. Note that if you have a particularly large program that results in a large number of control paths, you only need to list 10 test cases based on your flowchart.

2. Test your program using the input. If it doesn’t give the expected output, find the error and fix it.

Your flowchart can be done by hand or the computer, but must be submitted on Moodle. So if you draw it on paper you will need to take legible pictures or scan it.

VI. EXTRA CREDIT (only if everything else works)

If you choose to do extra credit, it must be submitted in a separate file with “extraCredit” in the file name.
Create a longer story line, with paths where there are at least 3 decisions in a row. At least one of these decisions must use “and” or “or” to combine multiple boolean expressions into a single decision.
Briefly note in your introductory comments what was added for the extra credit.

VII. ASSIGNMENT REMINDERS

Follow the programming assignment requirements document for comments, formatting, etc.

VIII. REFLECTION

Write a short reflection about the programming assignment in reflection.txt: what did you learn, what would you do differently next time, what was difficult? This should be no more than a page.

IX. FINAL SUBMISSION due 2/15

1. To GitHub:
1. Your .py file
2. Your extra credit .py file if you did the extra credit (make sure “extraCredit” is in the filename)
3. Your final algorithm, including the changes you made based on the design feedback, in designFinal.txt
4. Your reflection of the programming assignment in reflection.txt.
2. To Moodle:
1. A flowchart of your program with control paths labeled (as a pdf or picture — make sure it’s legible and the lines are clear)
2. Your test cases based on your flowchart in testcases.xlsx. You should have at least 1 test case per control path, using boundary values (see notes #7). However, if your story was particularly large, you only need to list 10 test cases and can ignore the others.

***Remember to double check on github.com that your files pushed. If they didn’t, you need to push them. Your instructor can only see what is on github.com, not what is only on your computer.***