Contents

Overview

In this PA, you will extend your PA1 so that it's bigger and better. You will add three new features: loops to help deal with bad input from users, functions to help organize and modularize your code, and new scenes to make your game more interesting. PA2 will be broken into three milestones, as listed below.

At the start of this PA, you don't know what functions are—that's okay, that part won't be due until milestone 2.

(Back to top)

Specifications

Your completed submission must have at least the following components (you're welcome add additional features to the game!):

(Back to top)

Milestones

Milestone 1: Design + Loops

You'll complete to independent advances in this first milestone: revising your design sketch from PA1 to include the three new scenes and adding comments to your PA1 code to show where and how you would implement loops to deal with user input. These are outlined below.

Design sketch: Updated your design to include the three additional scenes, the choices offered to the player for those scenes, how those choices will affect player attributes, and how the scenes link to other scenes.

Loops: In your PA1 code, locate all of the places where you will use a loop to check the player's input.

Submit your sketch in PDF, txt, PNG, or JPG formats and your .cpp file to here. You can view the rubric here.

Milestone 2: Function design

For this milestone, you must determine what your functions will be, including their name, what data must be passed in as parameters, and what will be returned, if anything. As mentioned above, you will have one function per scene, and then you must come up with three additional, non-main functions. You should think about not only what the functions will do, but where they will be called.

Update your code to include the stubs for all of the functions you've brainstormed. Recall that a stub is the function definition with an empty body, and if the function has a non-void return type, then the only thing in the body should be a return statement that returns a default value of the correct type (e.g,. return 0; if the return type is int). Each stub should include a JavaDoc styled comment above describing what the function does. Inside of the function, you should place comments describing what must be done, including what other functions will be called.

Including main, there should be a total of ten functions. Make sure the program compiles.

Submit your .cpp file here. You can view the rubric here.

Milestone 3: Completed assignment

Complete your program in an incremental fashion: consider one function stub at a time. For that stub, implement the body either by moving existing code into the function or implementing it from scratch. Ensure that it compiles and runs after each function you implement.

Submit your .cpp file here. You can view the rubric here (it's a different rubric from the previous milestones).

(Back to top)