STUDYSHIELDS ASSIGNMENT HELP

  • Home
  • Blog
  • Courses
    • Child Category 1
    • Child Category 2
    • Child Category 3
    • Child Category 4
  • Services
  • Country
    • Childcare
    • Doctors
  • Home
  • Blog
  • Sample Works
  • Order Now

Thursday, February 18, 2016

Mastermind is a game requiring skill and analytical thinking

 February 18, 2016     No comments   

Mastermind is a game requiring skill and analytical thinking.  Normally, Mastermind includes a board and different colored pegs lined up in a particular order.  In this version, the computer will randomly place four numbers (chosen from the numerals 1–6, allowing duplication) in a one-dimensional array and then ask the player to input four numbers until all four numbers are correctly guessed in the right order.
Of course, you will have to make sure the computer helps the player along a bit.  After the player inputs a guess, the computer should analyze it and tell the player (a) how many of his or her guessed digits were correct, but in the wrong place, and (b) how many of the guessed digits were correct and in the right place.  This can be done by using functions that compare the guess with the actual array of integers, looking for matches.
Remember the minimum requirement is two functions other than main.  Each function should perform a single task.

Sample Run:

Welcome to Mastermind

Please enter your four numerical guesses (space separated): 2 4 3 1

You have 2 correct number and 1 correct location.

Please enter your four numerical guesses (space separated): 4 5 3 2

Correct!

You are a MasterMind!


Hint:
When you are comparing the actual numbers to the user’s guesses, it may be easiest to use a copy of the array containing the user’s guesses.  Then, each time you find a match (either exact or in the wrong location), change that guess to a –1.  This way, you won’t end up counting a single guess more than once.
Lab 16
Extra Additives
Objective:
To reinforce skills in defining and manipulating arrays,with the vector class.
Computers store decimal numbers in binary form to conserve memory.  Even though this allows a greater range of values, the largest integer value in many systems is 32,767 and long integers, the largest value is less than 2.2 billion.

Your task is to write a program, using a minimum of three functions that input pairs of numbers between 0 and 100 billion, inclusive.  You should then add these numbers together and print the results.

Input:

The input will only consist of digit characters (‘0’ . . ‘9’).  No commas or other punctuation will be in the data.  All values will be non-negative.  Since the integers may exceed any binary integer value allowed in the system, we shall read in the values as a string and convert each integer character to its corresponding integer digit and store it in an integer array.

Output:

Your program should print out the results of the addition.  Do not print any leading zeros before any answer.  Put a loop in your program to run it four times.

Examples:
Input:
Output:
124235
7453
325235
0
23523
100000000000
326346124
76434124235
The sum is: 131688

The sum is: 325235

The sum is: 100000023523

The sum is: 76760470359


Use the declarations at right to store your digits.
vector<int> largeInt1 (12,0); // initialize to zero
vector<int> largeInt2 (12,0); // initialize to zero
vector<int> finalInt (13,0);   // initialize to zero


To convert digit characters to digit integers you may use this function.

int asciiToInt (char ch)
{
 return (ch – ‘0’);
}
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Click Here to Place order

Popular Posts

  • A “criminal minds” Aileen Wournos individual will be your “patient”
     A “criminal minds” Aileen Wournos individual will be your “patient”  A brief history of the patient including diagnoses (documented or your...
  • CEO Jane Lionel has some hard decisions to make with regard to some of the company’
     CEO Jane Lionel has some hard decisions to make with regard to some of the company’solder hands, and even on the eve of that decision, I be...
  • Problem in Supply Chain
    Problem in Supply Chain Problem 2. (Chapter 11: The Storage and Handling System) Compare the constrast private ownership of storage space to...

Recent Posts

Unordered List

Pages

  • Home

Text Widget

Blog Archive

  • November 2022 (20)
  • October 2022 (50)
  • September 2022 (119)
  • August 2022 (107)
  • February 2022 (501)
  • January 2022 (443)
  • December 2021 (488)
  • November 2021 (1574)
  • October 2021 (28)
  • September 2021 (11)
  • July 2021 (8)
  • June 2021 (15)
  • May 2021 (39)
  • April 2021 (15)
  • March 2021 (303)
  • February 2021 (712)
  • January 2021 (903)
  • December 2020 (2)
  • September 2020 (33)
  • April 2016 (5183)
  • March 2016 (3763)
  • February 2016 (4356)
  • January 2016 (1749)
  • December 2015 (22)
  • November 2015 (147)
  • October 2015 (23)

Sample Text

Copyright © STUDYSHIELDS ASSIGNMENT HELP | Powered by Blogger
Design by Hardeep Asrani | Blogger Theme by NewBloggerThemes.com | Distributed By Gooyaabi Templates