[Solved] SOLVED:Introduction to Software Engineering Assignment 1 solution

$25

File Name: SOLVED:Introduction_to_Software_Engineering_Assignment_1_solution.zip
File Size: 612.3 KB

SKU: [Solved] SOLVED:Introduction to Software Engineering Assignment 1 solution Category: Tag:
5/5 - (1 vote)

ObjectiveThe objective of this assignment is to practice Object-Oriented Programming (OOP) in C++.TaskIn this assignment, your task is to write a game that allows a human player to guess a 4-digit password in six trials.Before the Game StartsBefore the game starts, your program has to ask the player to input his/her name. The player name has to contain at least one alphabet character (i.e., A Z or a z). If not, your program will ask the player to enter the name again until the player name is valid. In addition, the name may contain space characters. (Hint: use getline(cin, nameOfPlayer) to read the input, where nameOfPlayer is a string variable. You have to type #include Game FlowWhen the game starts, your program will randomly generate a 4-digit password with no duplicate digits. For example, 1740 is a valid password, but 1741 is not. The password will be guessed by the player in at most six trials. The message <player_name, you have to guess a 4-digit password in 6 trials! is shown.In each trial, your program should display Make a guess: to ask the player to input a 4-digit number with no duplicate digits. If the input format is not correct (e.g., consists of more than or less than 4 digits, contains duplicate digits), your program should display the message Your guess should be a 4-digit number with no duplicate digits. and ask the player to input again until the input format is correct (this will consider the same trial). After receiving a guess in correct format, your program will check the guess of the player against the password generated when the game starts. If the guess is not correct, four hint symbols will be displayed to give a hint to the player and the number of trials left also will be displayed, where the message is Hint SymbolSemanticsOCorrect number in correct position.Correct number but in wrong positionXWrong numberTable 1: Different hint symbols and their semantics.2For example, if the password is 1740 and the players guess is 1234, then the four hint symbols will be OXX.. If the player can guess the password in six trials, the game ends and the message <player_name, you have cracked the password! Congratulations! will be displayed. If the player uses up all the trials, the game ends and the message <player_name, you have used up all trials! The password is <password! Game Over! will be displayed. For both cases, the program ends after displaying the aforesaid message.Additional RequirementYou are required to implement this assignment in OOP style with the principles of encapsulation and information hiding. Your program should contain at least three classes, namely PasswordPanel, Player, and PasswordGuessingGame, and your main function should not contain more than 30 lines of code.Assume that the password is 1643. Two sample runs are shown as follows (underlined bold characters are input from the user):Please enter your name: Agent 13Agent 13, you have to crack a 4-digit password in 6 trials!Make a guess:0123X.XO (Number of trials left: 5)Make a guess:1453O.XO (Number of trials left: 4)Make a guess:1643Agent 13, you have cracked the password! Congratulations!Please enter your name: 123Your input has to contain at least one alphabet character.Please enter your name: 12 3Your input has to contain at least one alphabet character.Please enter your name: MeMe, you have to crack a 4-digit password in 6 trials!Make a guess:0120Your guess should be a 4-digit number with no duplicate digits.Make a guess:a123Your guess should be a 4-digit number with no duplicate digits.Make a guess:a1234Your guess should be a 4-digit number with no duplicate digits.3Make a guess:0123X.XO (Number of trials left: 5)Make a guess:3210.X.X (Number of trials left: 4)Make a guess:4567.X.X (Number of trials left: 3)Make a guess:5678XOXX (Number of trials left: 2)Make a guess:7890XXXX (Number of trials left: 1)Make a guess:0987XXXX (Number of trials left: 0)Me, you have used up all trials! The password is 1643! Game Over!DeclarationAs required by the University, please place the following declaration as the comment in the beginning of your source code. CSCI2120 Introduction to Software Engineering Assignment <assignment_number I declare that the assignment here submitted is original except for source material explicitly acknowledged. I also acknowledge that I am aware of University policy and regulations on honesty in academic work, and of the disciplinary guidelines and procedures applicable to breaches of such policy and regulations, as contained in the following University website: http://www.cuhk.edu.hk/policy/academichonesty/. Student Name: <your_name Student ID: <your_student_ID Date: <dateAssessment SchemeCorrectness: 70% Class Design: 20% Program readability (e.g., indentation, comments, meaningful variable names, etc.): 10%4Please make sure that your program can compile successfully or you will get a very low score. Please also be reminded that your TA will read your code and can identify similar submissions easily. Consequences of confirmed plagiarism cases can be failing of the course and receiving a demerit.Testing PlatformYour program will be tested in the following platform: Windows 7 Visual Studio 2013SubmissionPlease follow the following steps to submit your work. Step 1: If you only have one .cpp source file, please save your source file as Resubmissions are allowed. But only the latest one will be counted. Late submissions within three days can only receive 70% of the marks. Late submissions more than three days will not be graded.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] SOLVED:Introduction to Software Engineering Assignment 1 solution
$25