
” MCD4720 编程调试、 写作MCD4720程序Foundations of C++Assignments 2 and 3 MastermindMCD4720 – Fundamentals of C++Assignment 2 and 3 – Trimester 1, 2021Assignment SubmissionsThis project will be Submitted in two parts. Both parts of the assessment are equally important forthe successful completion of your project, so it is essential that you understand the requirementsof both parts before you start. Assignment 2: Mastermind (Part A: Project Plan)Due Date: April 9, April 12, 2021, 11:55PM (Week 6 7)Marks: This assignment will be marked out of 100 points.Weighting: 10% of your final mark for the unit.This assignment is the first part of a larger project, which you will complete in Assignment3. This task consists of your project planning documentation. It will include details of therequirements analysis of your program, including UML Class diagrams.The purpose of this assignment is to get you comfortable with planning a C++ programmingproject for Assignment 3. The task is detailed later in this assignment specification, as arethe specific marks allocation. Assignment 3: Mastermind (Part B: C++ Project Implementation)Due Date: May 3, 2021, 11:55PM (Week 10)Marks: This assignment will be marked out of 100 points.Weighting: 20% of your final mark for the unit.This assignment consists of your implementation of your project, as outlined in your ProjectPlanning document (Assignment 2).Your project must follow your project plan and must be submitted as a Visual Studio project,including all header and .cpp files, and any appropriate text files to ensure the programcompiles and runs.This assignment consists of one Application file and associated custom Class files. Thepurpose of this assignment is to get you comfortable with designing and implementing basicmulti-class C++ programs. The task is detailed later in this assignment specification, as arethe specific marks allocation.2Foundations of C++Assignments 2 and 3 MastermindLate submission: By submitting a Special Consideration Form or visit this link: httpss://lms.monashcollege.edu.au/course/view.php?id=1331 Or, without special consideration, you lose 5 marks of your mark per day that you submit late (includingweekends). Submissions will not be accepted more than 5 days late. This means that if you got Y marks,only Y-n*5 will be counted where n is the number of days you submit late. Assessment items will not be accepted after more than 14 calendar days unless a Special Considerationapplication has been approved. This 14-day time frame does not apply to assessments due in Week 12.Marks: This assignment will be marked out of 100 points, and count for 10% of your total unit marks.Plagiarism: It is an academic requirement that the work you submit be original. If there is any evidence of copying(including from online sources without proper attribution), collaboration, pasting from websites or textbooks, Zeromarks may be awarded for the Whole assignment, the unit or you may be suspended or excluded from your course.Monash Colleges policies on plagiarism, collusion, and cheating are available here or see this link: httpss://www.monashcollege.edu.au/__data/assets/pdf_file/0010/17101/dip-assessment-policy.pdfFurther Note: When you are asked to use Internet resources to answer a question, this does not mean copy-pastingtext from websites. Write answers in your own words such that your understanding of the answer is evident.Acknowledge any sources by citing them.3Foundations of C++Assignments 2 and 3 MastermindSubmission Instructions:This project will be submitted in two parts: Assignment 2 Part A: consists of your project planning documentation.This document will include an outline of your program structure and UML Class diagrams.The assignment must be created and submitted as a single Word or PDF document to theMoodle site. This document must clearly identify both your Name and Student ID to facilitateease of assessment and feedback.Your document file MUST Be named as follows:YourFistNameLastName_A2.docx or YourFistNameLastName_A2.pdf.This file must be submitted via the Moodle assignment submission page.The document should contain the project plan and the UML diagrams. You can use MicrosoftVisio to draw the UML diagrams or you can use any other software, provided that thediagrams are included in your submitted document.Explicit assessment criteria are provided, however please note you will also be assessed onthe following broad criteria: Detail of a proposed project plan for the overall project. Creating accurate and complete UML diagrams. Applying a solid Object-Oriented Design (OOD) for the overall project Using appropriate naming conventions, following the unit Programming Style Guide. Assignment 3 Part B: consists of your implementation of your game project.Your project must follow your project plan and must be submitted as a Visual Studio project,including all header and code files, and any appropriate text files to ensure the programcompiles and runs.You may complete the tasks in your preferred IDE, however you MUST create a VisualStudio project in order to Submit. Your project folder must be identified by using your nameand assignment number, such as YourFirstNameLastNameID_A3.The entire project folder must then be zipped up into one zip file for submission. The zip fileMUST be named YourFistNameLastName_A3.zip. This zip file must be submitted via theMoodle assignment submission page.Explicit assessment criteria are provided, however please note you will also be assessed onthe following broad criteria: Meeting functional requirements as described in the assignment description Demonstrating a solid understanding of C++ concepts, including good practice Demonstrating an understanding of specific C++ concepts relating to the assignmenttasks, including object-oriented design and implementation and the use of Pointers Following the unit Programming Style Guide Creating solutions that are as efficient and extensible as possible Reflecting on the appropriateness of your implemented design and meeting functionalrequirements as described in the assignment description4Foundations of C++Assignments 2 and 3 MastermindNOTE! Your submitted program MUST compile and run. Any submission thatdoes not compile will automatically awarded a 50 marks penalty. Thismeans it is your responsibility to continually compile and test yourcode as you build it.NOTE! Your submitted files must be correctly identified and submitted(as described above). Any submission that does not comply will receivean automatic 20 marks penalty (applied after marking). For assignment 3,your Visual Studio Project should include all .cpp and .h files.If you have any questions or concerns please contact your tutor as soon as possible.5Foundations of C++Assignments 2 and 3 MastermindAssignment 2: Master Mind (Part A)You are to implement a computer-based variant of the board game Master Mind. This is a twoplayerdeduction game played with a specialised game board in which the aim of the game is tobreak the hidden code in the fewest number of moves.You can watch a video on how to play here: httpss://www.youtube.com/watch?v=ZSXpmIH-_d4 orread this article: httpss://www.wikihow.com/Play-Mastermind or even play an online version here: https://www.webgamesonline.com/mastermind/.In your version, you will be the code breaker, playing against the computer who is the code maker.For Part A of the assignment you will focus on the planning of the project. In Part B you will focuson creating the various interactive objects in the game and program the player interactions.Basic Game PlayFirst, the code maker selects any 4 coloured pegs (from 8 differentcolours) in any combination to create the hidden code.The code breaker now attempts to determine the hidden code byselecting 4 coloured pegs at a time, and placing them in the order theythink matches the hidden code.After each guess, the code maker gives clues a black peg for thecorrect colour in the correct position, a white peg for the correct colourbut in the wrong position, leaving empty slots if the colours are not inthe code.The code breaker must guess the code in 10 turns or less, otherwisethey lose the game.In your version you can use words, letters, numbers or symbols for thecode.Human Player:You, as the human Player, must be able to input your choices for the hidden code as required bythe program. For example: if the program uses numbers for the code then you must enter 4numbers as your guess. After you enter your guess, the board will update, showing you theaccuracy of your guess. You continue until you have cracked the code (you win) or you have runout of turns (you lose).Computer Player:Obviously, you as a player can make strategic choices as to which colours to use when guessingthe hidden code. However, programming the computer breaking the code is beyond the scope ofthis assignment. Therefore, the computer will be assigned the role of code maker and the playerwill be the code breaker (see Assignment 3 brief for more details on this).6Foundations of C++Assignments 2 and 3 MastermindProject PlanHaving a clear plan for your project before you begin coding is essential for finishing a successfulproject on time and with minimal stress. So part of this assignment is defining what will be in yourproject 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 tocomplete the documentation required for Assignment 2.The documentation you must submit will include the following: A description of How to PlayThis will be the information you display on the opening screen of your game to inform the playerwhat they need to do in order to play and win the game. Do not just copy the game playdescription above, make your own description.Note: This description must be saved as a text file and read into your game when the programbegins. You can also use this as a convenient way to display help if the player asks for it. A development outline of your gameUsing a simple outline format (numbered or bullet points) state the main actions that theprogram will have and then, as sub-points, state the things you will need to do to make thathappen.The outline structure Should contain all the elements of your game, as this is a high leveldescription of your approach to the development of your program. You should include at leastthe following headings and provide examples of happens under each section. The game setup (everything that happens before the game starts) The players turn (the sequence of events that happen during a turn) Processing player input (include each of the commands your player can use) Providing feedback to the player (in response to the players interactions) The end game conditions (include all win and lose conditions) Additional Features included, if any see Assignment 3 Outline the functionality of all your game classes see Assignment 3Here is an example to get you started with your project outline:o The Game Setup Display an overview of the game rule so the player knows what to do to win. read this information from a text file Initialise the game elements: add the player ask for the players name, set default variables all the other things that will happen during initialisation including creating the game board initialising other game variables (list them here)As you can see, you only have to describe the actions the program will take, not the code, forthe outline. The idea here is to give you a starting point for when you start writing your code asyou can use this as a checklist of the things you need to include. UML DiagramsUML diagrams are designed to make structuring your program easier.How to create them will be covered in class, but the general structure isshown here see Assignment 3 for more details about classes.You will need UML diagrams for each of the classes you include in yourgame at least a Player, Board and Application (main) class.ClassNamelist of attributes(variables)list of behaviours(functions)7Foundations of C++Assignments 2 and 3 MastermindAssignment 2: Marking Criteria [100 marks in total]1. Requirements and Analysis Document (Project Plan) [80]1.1. Description of the rules (the introduction to your game) [8]1.2. Outline includes all game functionality (from Part B) [12]1.3. Each section is broken into logical tasks [15]1.4. Tasks are performed in a logical order [15]1.5. Task descriptions given provide sufficient detail [30]2. UML Diagrams [20]2.1. Correct Structure used (Name, Attributes, Behaviours) [4]2.2. Included the correct designations for public (+) and private (-) data [8]2.3. All variables and functions have meaningful names [8]Assignment 3: Master Mind (Part B)You are to implement the Master Mind game you started in Assignment 2 by creating a VisualStudio Project using your project plan as described in your previous submission.Your completed Master Mind game must demonstrate the following: You MUST implement your program using the following classes, as a minimum, you mayinclude more (as appropriate for your game design): Player class: holds a players details including their name, score, wins and the numberof games played. Board class: holds the current games details including each of the players previousmoves and associated clues, the number of rows and columns used in the game. Application file: holds the main() function and controls the overall flow of the game.You may include other relevant attributes and behaviours to these classes, as identified inyour project plan. The Player must be able to do the following: assign a name which is requested at the start of the game and used in the feedback given see all their previous moves at the start of their turn so they can make an informed choice type in a code, using either letters or numbers and seeing appropriate feedback on theaccuracy of their input continue typing in codes and seeing feedback until they either crack the code or run outof turns quit the game at any time during or after a game The Board in the game should have the following characteristics: a defined number of columns (code slots) and rows (the maximum turns a player has) be able to display each code entered and given feedback as a specific row be able to reset the board to empty at the end of a game not be able to add any more rows beyond the specified number8Foundations of C++Assignments 2 and 3 Mastermind The Game Application must do the following: display the how to play information at the start of the game create or select a secret code using words/letters, symbols and/or numbers display an appropriate and uncluttered user interface providing relevant information to theplayer at all times ask for and allow the player enter a code compare the players code to the secret code and provide appropriate feedback to theplayer (a symbol for a correct letter/number in the correct position and a different symbolfor a correct letter/number but in the wrong position, it is optional to use another symbolif the letter/number is not in the code) display the updated game board after each code entered by the player terminate the game (player wins) when the player has guessed the code terminate the game (player loses) when the player has run out of turns provide player stats at the end of the game (wins, loses and score) the player should be able to QUIT the game at any timeProgram ReflectionYou must also provide a 300-word written reflection of your object-oriented design and how wellyou believe it was to implement. You should cover the following areas: Discuss why you designed it the way you did. Why did you create your classes that way? How does this reflect an OO design or approach? Discuss how well you were able to code it Highlight any issues You found once you tried to implement your design. How did you resolve these issues? If you were to do this project again, discuss how you might change your design to make yoursolution easier to implement, more efficient, or better for code reuse.This must be a Word or PDF document which must be included in the same folder as your *.slnfile. Your document file MUST be named as follows:YourFistNameLastName_A3.docx or YourFistNameLastName_A3.pdf.Extra FunctionalityThe marking criteria indicates that you should make some individual additions to this in order toachieve the final 20% of the mark.Following is a list of additional features you can include, with the maximum number of marks [x]you can earn for each one. You may implement one or more features from the list, but you willonly score up to the maximum of 20% of the total assignment marks or 20 marks.You should aim to add some additional creative elements to the gameplay, as well as advancedobject-oriented design elements or advanced use of pointers. Add a theme to the game which is incorporated into the game play through the story andthe feedback given (for example: Word Detective, Number Cruncher, etc.) [2] The player can select a skill level [eg: Novice (Detective), Thinker (Inspector) and MasterMind (Chief Inspector)] which modifies the game parameters the number of elements inthe code and the number of rows (turns) the player has to solve it. For example: easy has 49Foundations of C++Assignments 2 and 3 Mastermindelements out of 6 with 10 rows, tricky has 5 elements out of 8 with 12 rows and hard has 6elements out of 10 with 14 rows. [4] Implement an appropriate scoring system based on the game parameters number of turnstaken, a bonus for unused rows, +/- point based on a win or a loss, etc. [3] Read in word and/or element lists from a file (based on word length, such as 4-, 5- and 6-letter words, numbers or symbols) and store appropriately. Word lists should have at least20+ words of each length. The list used in the game could be linked to a player skill leveland/or randomly selected at the start of each game. To help you a text file (jotto.txt) hasbeen given, you can find it on Moodle. [6] Give the player additional options apart from just typing the code or quitting the game. Thiscould include options to: ask for Help (displays an information screen loaded from a file), askfor a hint (displays a random element from the secret code and must be a limited option),ask to resign from the current game but not quit the entire game (ends the current game asif the player ran out of turns and displays the secret code). [4] Display the board using ASCII art. [4] Allow the game to be saved and restored at the players request. [4] Allow the player to select what elements will be used in the code (numbers, symbols, letters,words). Words should range from 4- to 6-letter words, while a specific range of numbers orset of letters/symbols should be clearly identified and displayed to the player. The feedbacksymbols can remain the same, you can use (jotto.txt). [5] Ask the player if they want to be promoted to the next skill level after winning 5 games. Ifthey accept their skill level is increased by one (to the maximum level permitted in yourgame). Also, if the player loses 5 games in a row they are automatically demoted one skilllevel (to the minimum level permitted in your game). [5] Implement a more sophisticated computer player. The computer player should be able tohave its own Player object (including name and any other player stats as required for yourgame), and score the points the human player would lose plus earn a suitable bonus for thewin. It should also make intelligent choices for words/letters, symbols or numbers includingusing doubles or triples of the same letter/symbol/number. It should also have the ability togive random comments to the player based on how well (or not) the player is doing. [10]You certainly do not have to implement all of the above to earn marks for extra functionality. Justremember the maximum number of marks you can earn are given in [x]. It is up to you!10Foundations of C++Assignments 2 and 3 MastermindAssignment 3: Marking Criteria [up to 100 marks in total]Does the program compile and run? Yes or No 50 marks penalty will be applied for a non-compiling program.1. Class Design [15]1.1. Player Class [5]1.1.1. Has an appropriate header file [2]1.1.2. Required data members and member functions using meaningful names [1]1.1.3. Contains only aspects that relate to a player (has no data members or member functions thatare not directly related to a Player) [2]1.2. Board Class [5]1.2.1. Has an Appropriate header file [2]1.2.2. Required data members and member functions using meaningful names [1]1.2.3. Contains only aspects that relate to a board (has no data members or member functions thatare not directly related to the board) [2]1.3. Game Application [5]1.3.1. Has an appropriate header file [2]1.3.2. Has appropriate variables and functions using meaningful names [2]1.3.3. The main() function has appropriate function calls to keep it uncluttered [1]2. Functionality [35]2.1. Game set up including: displaying how to play information, initialising the player and gamevariables, creating the secret code using appropriate data, etc. [5]2.2. Implementation of a clear and uncluttered User Interface display [5]2.3. Successful implementation of action processes [5]2.4. Successful implementation of calculating and displaying the correct clues [5]2.5. Appropriate feedback to players interactions [5]2.6. Appropriate feedback displayed to the player [5]2.7. Appropriate end game conditions triggered [5]3. Quality of Solution and Code [20]3.1. Does the program perform the functionality in an efficient and extensible manner? [12]3.1.1. Appropriate use of functions and function calls [1]3.1.2. Appropriate use of data types [1]3.1.3. Appropriate use of decisions, loops and other programming techniques [2]3.1.4. Appropriate use of references and/or pointers [5]3.1.5. Appropriate use of good programming practices and techniques [2]3.1.6. Extraneous and redundant code removed [1]3.2. Has a well-designed OO program been implemented? [4]3.2.1. Contains classes appropriate to the assignment brief [3]3.2.2. Program structures support and OO design [1]11Foundations of C++Assignments 2 and 3 Mastermind3.3. Has the Programming Style Guide been followed appropriately? [4]3.3.1. Appropriate commenting and code documentation [2]3.3.2. Correct formatting of code within *.h and *.cpp files [2]4. Extra Functionality [maximum 20]4.1. Incorporate a theme into the story and feedback given to the player [2]4.2. Implement Difficulty levels which may be selected by the player [4]4.3. Implement an appropriate scoring system based on game parameters [3]4.4. Read word lists from a file and store appropriately [3]4.5. Player has additional command choices [4]4.6. Display the board using ASCII art [4]4.7. Allow the game to be saved and restored at the players request [4]4.8. Allow player to select which elements to use [5]4.9. Player promotion/demotion every 5 games won/lost [5]4.10. Implement a more sophisticated computer player [10]5. Reflection [10]5.1. Discussion of motivations for the program design [3]5.2. Discussion of how well the design was to implement [3]5.3. Discussion of what they would do differently if they were to start it again [4]Assignment Notes:It is your responsibility to know what is expected of you. If you are unsure about anything, askyour tutor sooner rather than later. Write any questions and/or notes here to help you clarify whatyou have to do.Note: Your tutor may ask you to program part of your assignment in classto determine that you have completed the work yourself. Failure to do thisto an acceptable level will result in you being referred to the SubjectLeader for plagiarism.In-Class interviews: Also, you may be required to demonstrate your codeto your tutor after the submission deadline. Failure to demonstrate willlead to zero marks being awarded to the entire assignment.Note: Submitting only .Sln file, a zero mark will be granted.12Foundations of C++Assignments 2 and 3 MastermindHere are some sample screen shots to help you develop your user interface:13Foundations of C++Assignments 2 and 3 Mastermind请加QQ:99515681 或邮箱:99515681@qq.com WX:codehelp
“
添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导。







