Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Foundations of C++

Assignments 2 and 3 – Risky Business Simulation

Assignment Submissions

This project will be submitted in two parts. Both parts of the assessment are equally important for the successful completion of your project, so it is essential that you understand the requirements of both parts before you start.

You may complete the tasks in your preferred IDE; however you MUST create a CLion project in order to submit. Your project folder must be identified by using your name and assignment number with the entire folder zipped into a single zip file for submission.

w Assignment 2 :: Risky Business Simulation (Part A: Project Plan & Prototype) Due Date: Sunday of Week 8

Marks: This assignment will be marked out of 100 points.

Weighting: 25% of your final mark for the unit.

This assignment is the first part of a larger project, which you complete in Assignment 3. This task consists of your project documentation and an initial prototype.

The documentation must include a flowchart, all UML class diagrams of your programme and a test plan for your final project.

The prototype must include the application class (Main) and the following base classes, including individual header and definition files:

. Player: stores data about the player such as their name, health, inventory, etc.

. Company: stores data about the different companies (inheritance applies here)

. Risk: stores data about “risks” the player may take during the game – please note that there is also an advanced Extra Functionality option for this class

The Main class, for this part of the project, focuses on the testing of each of your classes similar to the way you tested the different classes in the studios from Week 5 onwards and displaying the main user interface correctly.

The purpose of this assignment is to get you comfortable with planning and developing a C++ programming project which you will complete for Assignment 3. The task is detailed later in this assignment specification, as are the specific marks allocation.

w Assignment 3 :: Risky Business Simulation (Part B: C++ Project Implementation) Due Date: Monday of Week 14

Marks: This assignment will be marked out of 100 points.

Weighting: 35% of your final mark for the unit.

This  assignment  consists  of your  implementation  of  your  project,  as  outlined  in  your  Project  Planning document (Assignment 2)  including one Application file and associated custom Class files,  including all header and cpp files, and any appropriate text files to ensure the programme compiles and runs.

The purpose of this assignment is to get you comfortable with designing and implementing basic multi-class C++ programmes and following your project plan. The task is detailed later in this assignment specification, as are the specific marks allocation.

Submission Instructions: Read These Carefully

This project will be submitted in two parts:

w Assignment 2 – Part A: consists of your project plan documentation and prototype.

The document must include an overview of your program structure as a flowchart, UML Class diagrams and test plans for the required scenarios. You can use Microsoft Visio to draw the flowchart and UML diagrams, or you  can  use  any  other  software,  provided  that  the  diagrams  are  included  in  your  submitted  document (PowerPoint is also a useful tool).

The documentation must be created and submitted as a single Word or PDF document and the prototype must be created in CLion as a single project. Both tasks must clearly identify both your Name and Student ID to facilitate ease of assessment and feedback.

Your document MUST be named as follows:

A2-YourFirstNameLastName.docx” or “A2-YourFirstNameLastName.pdf” .

Your CLion project folder must be identified using your name as follows:

A2-YourName-Prototype

All files must be submitted via the Moodle assignment submission page in a single ZIP file that MUST be named A2-YourFirstNameLastName.zip” .

Explicit assessment criteria are provided, however please note you will also be assessed on the following broad criteria:

ü Detail of a proposed project plan for the overall project.

ü Creating accurate and complete flowchart and UML diagrams.

ü Applying a solid Object-Oriented Design (OOD) for the overall project

ü Using appropriate naming conventions, following the unit Programming Style Guide.

w Assignment 3 – Part B: consists of your implementation of your final game project.

Your project must follow your project plan and must be submitted as a CLion project, including all header and code files, and any appropriate text files to ensure the programme compiles and runs.

You may complete the tasks in your preferred IDE, however you MUST create a CLion project in order to submit. Your project folder must be identified using your name and assignment number: “A3-YourName- Final”.

The entire project folder must then be zipped up into one zip file for submission. The zip file MUST be named “A3-YourFirstNameLastName.zip”. This zip file must be submitted via the Moodle assignment submission page.

Explicit assessment criteria are provided, however please note you will also be assessed on the following broad criteria:

ü Meeting functional requirements as described in the assignment description

ü Demonstrating a solid understanding of specific C++ concepts relating to the assignment tasks, including OO  design,  implementation  and  appropriate  use  of  pointers,  inheritance  and  polymorphism,  a  good programming practice techniques.

ü Creating solutions that are as efficient and extensible as possible

ü Reflecting on the appropriateness of your implemented design and meeting functional requirements as described in the assignment description

Please ask your tutor for clarification of any aspects of the assessments you do not understand as soon as possible because this project is worth 60% of your overall marks.

Major Project Overview: Risky Business Simulation

In this assignment, you are to design a Risky Business Simulation game, where you buy and sell shares in a number of different companies. You must use your corporate powers gained from the acquisition of companies to increase your wealth and assets in order to win the game!

For Part A of the assignment you will focus on documenting and prototyping the project with the three base classes required demonstrating your class design and basic testing to ensure the classes are ready for your final game implementation. In Part B you will focus on developing the game setup and player interactivity demonstrating the implementation of the game interface design and the more complex aspects of the player’s interactions within the game environment.

Game Overview

Objective: You must manage a Share Market Portfolio by buying and selling the shares in one or more companies. To be the first player to own the target number of companies and have at least the minimum amount of cash to win the game.

Setup: You set the Difficulty level (1-3) and the number of players (1-4) with their names. The number of companies to own, the minimum amount of Cash in Hand required and the number of days you have left is set by the Difficulty Level.

Play: The game can be quite tricky, so be careful to take risks only as necessary and manage your assets as responsibly as possible.

The game is played over a number of days, in which each player has one turn. You may choose one of the following actions:

ü [B]uy shares in a company - up to as many as you can afford

ü [S]ell shares in a company - up to as many as you own

ü [A]cquire a company by paying its cost in shares

ü [P]ower uses a corporate power to gain an immediate bonus

ü [R]isks may pay off (or not) so use with caution (advanced)

ü [Q]uit ends the game for the player selecting it

The Share Market changes the price of shares every day so think carefully when you will buy and sell your shares.

The Required Game Interface

The main game interface must display

all the information as shown here è

This includes the following:

ü The game title.

ü The required win/end conditions.

ü Display the current values for all

company shares, value and cost.

ü The title of the current player and

total assets and share portfolio.

ü Followed by the options a player

may take during their turn with an

appropriate prompt message.

ü This screen must be cleared and

updated after a player’s turn (so

there is no scrolling).

Individual prompts and procedures are

detailed in the relevant sections under

Part B.

For ease of assessment you must use

the required interface (shown here and

partially in later screenshots).

Player Interactions

The choices a player has include [B]uy shares, [S]ell Shares, [A]cquire a Company, Use a Corporate [P]ower, Take a [R]isk and [Q]uit. The letter [?] is the shortcut key the player can use to execute that command. You can read a full description of each command option in Part B of the brief.

On your turn, you may choose one of the options shown. All advanced features are described in detail under the Extra Functionality section and make up 20% of the total marks for Part B of the project.

If you choose not to implement any advanced features you will forfeit these 20 marks.

Game Data is Provided

Text data files are provided for the introductory game blurb, Companies and the Risks as well as the permitted re- usable functions. Please use this data in your prototype and final game. A detailed breakdown of these files is provided in Part B of this document.

Assignment 2: Preparing the Risky Business Simulation (Part A)

Project Documentation

Having a clear plan for your project before you begin coding is essential for finishing a successful project on time and with minimal stress. So part of this assignment is defining what will be in your final project and what you need to do to actually develop it.

Important: You  must also read the requirements for Assignment 3 in order to be able to complete the documentation required for Assignment 2.

The documentation you must submit will include the following:

ü Flowchart of the entire game structure

In a nutshell, a flowchart is a visual representation of the game’s algorithm. It’s a useful tool that can help you see how your programme works. It makes it easier to focus on the flow of the game while developing your programme because you have already identified where all the game decisions and loops will be.

The symbols you’ll most likely need are:

Symbol

Title: what is it used for

Terminator: Use at the beginning and end of a flow sequence. When you begin a sequence, add

the name of the sequence in the symbol (eg: display map).

Process: Use to describe the current step or action in the sequence (eg: get input, read data from text file, display data in varName, etc.).

Decision: Use when the programme must choose something usually in the form of a question (eg: is Company owned? Has money left? etc.). Evaluates to true or false.

Pre-defined Process: Use when you want to link to another flowchart. This is only necessary for processes that require a finer level of detail (eg: “buy shares” would appear in the main flowchart then you could create another smaller chart describing what happens when you buy shares). It’s not necessary for things like, get user input or display title.

The level of detail required is “big picture” not “fine detail”. We don’t necessarily need to know all the fine details, as that is something we’ll see in your code, but we need to be able to understand how you are thinking and processing the various elements within your game.

Remember to keep your symbols concise and easy to understand by someone else. This is meant to be read by others so now is not the time to use secret codes that only you understand!

Tip: Use the Process box to show things happening in a sequence and the Pre-defined Process box to identify a function that encapsulates a specific task using an appropriate description.

Your flowchart should include:

w The game setup (everything that happens before the game starts)

w The player’s turn (the sequence of events that happen during a turn)

w Processing player input (the commands your player can use)

w Providing feedback to the player (in response to the players interactions)

w The end game conditions (include all win and lose conditions)

w Include the functionality of all your game classes see Assignment 3

w Any additional Features included, if any see Assignment 3

Here is an example to get you started with an algorithm that you can convert into your flowchart:

o The Game Setup

w Read game rules from text file and display

w Add the player(s) – ask for the players name, set default variables

w You must include all the other things that will happen during initialisation, such as:

. creating the companies, the risks and the game interface

. initialising other game variables

As you can see, you only have to describe the actions the program will take, not the code. The idea here is to give you a starting point for when you start writing your code as you can use this as a checklist of the things you need to include.

UML diagrams are designed to make structuring your program easier. How to create

them will be covered in class, but the general structure is shown here – see Assignment

2 brief for more details about classes.

You will need UML diagrams for each of the classes you include in your game – at least

a Player, Company, Risk and the Main (application) class.

ü Project Test Plan

Part of any project development strategy is the inclusion of a project test plan. This document lays the foundations of how you plan to test the various elements within a project to ensure that it remains robust and does not crash when being used by others.

In this part of the assignment you are required to identify how you will test each individual class (as per your prototype) and the main game play elements (as per your final implementation). We will use this test plan when we are marking both your prototype and final project to ensure that you have done the required amount of testing. We expect evidence of testing for the 3 required classes, and the following aspects of the game play – selecting options, and the win or lose end game conditions.

Create a table in your document, using the following example provided as a guide, filling each section with appropriate information that is specifically relevant to your implementation of the game.

How to create a test plan will be covered in the workshops with appropriate examples. You’ll also have time during the workshops and studios to practice creating your own.

Class

Function/Purpose

Sample Data Tested

Actual Result

Class Name

What’s its purpose?

Outline  its purpose in the game context.

How did you test it?

Include a range of values you tested to ensure the class did not cause an error.

What was the result?

Include  both successful and failed test results.

add other classes here

#Scenario

Function/Puropse

Sample Data Tested

Actual Result

Related to Scenario [?]

functionName()

What’s its purpose?

How did you test it?

Include a range of values you tested to ensure the function did not cause an error.

What was the result?

Include  both successful and failed test results.

add other functions here

You must include all your classes and all the related functions for the following game scenario criteria: 1) selecting an option: include each one and the test done to ensure correct functionality

2) end game conditions: include the player winning or losing the game with all possible outcomes