Program #2 Working with Variables and Conditionals

$24.99 $18.99

Design is very important when developing programs and there are a variety of ways to approach it. You may draw pictures, write it out in prose or structured text, use pseudo code, and more! The point of design is to give you a blueprint to follow while you are coding. This saves time debugging your…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Categorys:

Description

5/5 – (2 votes)

Design is very important when developing programs and there are a variety of ways to approach it. You may draw pictures, write it out in prose or structured text, use pseudo code, and more! The point of design is to give you a blueprint to follow while you are coding. This saves time debugging your program as you can catch mistakes early. It is better to spend one hour of designing than it is to spend five hours debugging.

For this assignment you must design a solution to the following problem statement and implement your solution.

Example Design Document: Polya_template.pdf

(h ps://web.engr.oregonstate.edu/~goinsj/resources/CS161/Polya_template.pdf)

General Grading Breakdown:

Understanding the problem. (Recognizing what is asked.) (5 pts)

Devising a plan. (Responding to what is asked.) (10 pts)

Carrying out the plan. (Developing the result of the response.) (75 pts)

Test Plan/Looking back. (Checking. What does the result tell me? ) (10 pts)

Problem Statement

The local middle school would like some text adventure games to keep their students occupied during down time. The school is leaving it up to your skill and good judgement to develop a game. It is up to you what the story and theme is but there are some requirements:

There must be at least five different “if” statements involved in the adventure

At least one of those “if” statements must contain a nested “if” statement

There must be an element of chance that would change a user’s chosen path

You must handle invalid input from the user.

An example run of the program could look as follows:

Hello and welcome to the Wilderness Adventure Game!

To go right enter 1, to go left enter 2: 1

You chose to go right. You have now entered the grasslands and are being followed by oxen. They look friendly.

11/30/2018 Program #2

Enter 1 to befriend the oxen, enter 2 to run from the oxen: 1

You attempted to befriend the oxen. You think you can ride one of them.

Enter 1 to attempt to ride the ox, enter 2 to walk away: 11

Oops! That wasn’t a valid response. Please try again: 1

Unfortunately fate was not on your side. [due to a random number within C++] You were thrown from the ox’s back and are forced to walk away. Enter 1 to walk right, enter 2 to walk left: 1

You chose to go right. You have now entered the swamplands and have spotted an approaching alligator. Enter 1 to h ide, enter 2 to run home: 2

You chose to go home. The adventure has ended.

The rest of the implementation is up to you, but try to make your game as clean and attractive to play as possible.

(25 pts) Design Documenta on

You should create a written document that addresses the points listed below. Please see the example

design template (https://web.engr.oregonstate.edu/~goinsj/resources/CS161/Polya_template.pdf) .

Understanding the Problem (5 pts)

What is the problem asking you to do? What are the inputs for the problem? What questions do you have about the problem?

Devising a Plan (10 pts)

What is the theme of the adventure going to be?

What are the options?

List the decisions you will give in your text adventure?

Which decisions will have an element of chance?

How are you going to create the element of chance?

How are you going to handle invalid input entered by the user?

Test Plan (10 pts)

You need to consider good and bad values for your program. Remember to include tests for less obvious invalid inputs such as the word “one”.

Input Value(s):

Expected Outcome:

Actual Outcome:

-100

Error message, prompt for a new

Crashes

input

1

Game moves to next phase on

Works

right

11/30/2018 Program #2

  • Output:

******************************************************/

Reminder

Every assignment in this course is graded by demoing your work for 10 minutes with a TA. You are required to meet with a TA within two weeks of the due date to demo. You can schedule a demo with a TA from the TA Office Hours tab in Canvas. The available times can be viewed in the far right column of the table (labeled “Grading Hours”). Click on one of the links to access the poll and insert your name in a specific time slot.

Demo Outside 2 Weeks: Assignments that are not demo’d within the acceptable time period will be subject to a 50 point deduction.

Demo Late Assignments: Late assignments must still be demoed within the two week demo period beginning from the assignment’s original due date.

Missing a Demo: If you miss your demo with a TA, you will receive a 10 point (one letter grade) deduction to that assignment for each demo missed.

Each program needs to be written according to the style guidelines

(https://web.engr.oregonstate.edu/~goinsj/resources/general/cpp_style_guideline.pdf) for this class. Remember that an important part of computer programming is making sure that your work is easily understandable by other programmers.

Electronically submit your C++ source code and your design documents by the assignment due date, using TEACH (https://engineering.oregonstate.edu/teach) . You may use one of the document scanners (available in KEC1130 and some other College of Engineering labs) to scan your paper design into a PDF document that can be submitted to TEACH (https://engineering.oregonstate.edu/teach) . Your submission will have two files: a .cpp file and a .pdf file containing your design paperwork.

Program #2 Rubric

https://oregonstate.instructure.com/courses/1698697/assignments/7388746 5/5

Program #2 Working with Variables and Conditionals
$24.99 $18.99