SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 314 Weeks Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 04 Jan 2018 My Price 10.00

program should print out instructions for the game

For this assignment, you will write a program to play the game Mastermind.Please see https://en.wikipedia.org/wiki/Mastermind_(board_game) for details of how to play the game.

Engineering Problem Solving II Spring 2017 Homework 5 Due: Friday, April 7 @ 5pm Homework Description For this assignment, you will write a program to play the game Mastermind. Please see https://en.wikipedia.org/wiki/Mastermind_(board_game) for details of how to play the game. Specifications: 1. Your program should print out instructions for the game. 2. A game consists of trying to guess a secret randomly generated, 4-digit code where each digit is a number from 1 to 6. 3. A player will have 12 guesses to guess the correct 4-digit code. 4. After each guess, your program must inform the player how many digits were guessed correctly in the correct location and how many digits were guessed correctly but in the wrong location. If the player guesses correctly, then your program should congratulate the player on successfully guessing the correct answer. 5. Your program must check that the user enters a valid guess, i.e., that it is exactly 4 digits and that each digit is a number from 1 to 6. 6. After finishing a game, your program should ask the user if they want to play again or quit the program. The program should play another game unless the user chose to quit the program. 7. Your program must include and properly use a function to check if the guess entered by the user is valid or not. The function should return true or false. 8. Your program must include and properly use a function to count the number of digits of the guess that are correct and in the correct position. This function must take as input the guess and the secret code to be guessed. The function should return the number of digits that are correct and in the correct location. 9. Your program must include and properly use a function to count the number of digits of the guess that are correct and in the incorrect position. This function must take as input the guess and the secret code to be guessed. The function should return the number of digits that are correct and in the incorrect location. 10. Your program should print out the secret answer at the beginning of each round for grading/debugging purposes. Note: Do not use cin or cout in your functions for 7, 8, or 9. You may combine the two functions described in 8 and 9 into a single function if you want. GRADING Rubric (100 points total): You will receive a zero on your homework if your program does not compile on an ECS Linux machine. Remember: late homework is not accepted. 75 points for working code: o 5 points for correctly printing out game instructions o 10 points for correctly generating a random code to guess o 10 points for correctly writing a function to check if the guess entered by the user is valid. This function must return true or false. o 5 points for correctly using the previous function to check if the user guess is valid or not. o 10 points for the function to correctly determine how many digits of the guess are in the correct location and reporting that to the player. o 15 points for the function to correctly determine how many digits of the guess are correct but in the incorrect location and reporting that to the player. o 10 points for the logic to repeat playing the game until the user decides to quit playing. o 10 points for properly passing variables to functions and returning values from your functions. 25 points for style (See the Style guide under Content on ICON): o 10 points for comment blocks for each function including main o 4 points for indenting o 7 points for sufficient in-line comments o 4 points for meaningful variable names NOTE: Submit a *.cpp file to the dropbox. Late homework will not be accepted. Contact the grader for possible regrade if your program received a zero for code that does not compile. DO NOT WORK TOGETHER! Students caught working together on this assignment will drop a whole letter grade for the course!

Attachments:

Answers

(5)
Status NEW Posted 04 Jan 2018 02:01 PM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)