I'm trying to build a program that has a user guess 4 random pegs in order. it needs to use arrays and methods and i'm struggling mightly... here are some parameters
The structures must be declared as variables in the main() method.You must write your program so that the number of digits in the random number can be changed. When you submit your answer, there should be 4 digits, but this should be easily changed in the program. Similarly, the number of guesses that the user can make should be defined and be easily changed.
You must not declare any variables outside of your methods, only constant values.
Your program must contain a method called chooseRandomNumber(). The method takes the structure holding the random number as its only argument. The purpose of the method is to fill the number with random digits in the range 0 to 9.
Your program must contain a method called getGuess(). The method takes two arguments, the structure holding the user's guess and the current guess number (i.e. 1st guess, 2nd guess etc). The method will prompt the user to enter a guess and read in the digits of the guess. If the user enters an invalid input, the method will print out an error method and loop back to allow the user to enter the guess again. The method must only return when the structure has been filled with digits.
Your program must contain a method called countBlackPegs(). This takes two …
zeroliken 79 Nearly a Posting Virtuoso
zeroliken 79 Nearly a Posting Virtuoso
zeroliken 79 Nearly a Posting Virtuoso
zeroliken 79 Nearly a Posting Virtuoso
zeroliken 79 Nearly a Posting Virtuoso
zeroliken 79 Nearly a Posting Virtuoso