C++ Help

Discussion in 'Programmer's Corner' started by SHuzero, Aug 21, 2011.

  1. SHuzero

    Thread Starter New Member

    Feb 22, 2011
    14
    0
    can help me to design a program that simulates a radio station's contest that awards a $10,000 prize to the first caller who correctly guesses a number in a list of randomly generated numbers. A caller can make one guess per call. The contest is held until a number has been matched or the user enters a value of -1. The code used to generate a random list between 1 and 500 is in createlist.cpp. The list generated from running is createlist is prizelist.txt. The following list is the file Prizelist.txt 42,468,335,1,170,225,479,359,463,465,206,146,282,329,462,492,496,443,328 and 437.

    I hope you can help me....
     
  2. SHuzero

    Thread Starter New Member

    Feb 22, 2011
    14
    0
    this is the sample output
    a message is displayed containing the winning number, the location in the list of numbers, the number of calls made, and the amount of the prize.

    Hello Caller. What number between 1 and 500 are you guessing ? 250
    250 is not in the list. Call again.

    Hello Caller. What number between 1 and 500 are you guessing ? 700
    Your guess must be between 1 and 500 inclusively.

    Hello Caller. What number between 1 and 500 are you guessing ? 42
    Caller. Your number 42 was found at location 1 of the list.
    Counting you, there were 2 callers. Your winning are $10,000

    It uses a arrays sequential search can you help me.....
     
  3. debjit625

    Well-Known Member

    Apr 17, 2010
    790
    186
    What you have done so far?any code you wrote... any example you tried...
     
  4. SHuzero

    Thread Starter New Member

    Feb 22, 2011
    14
    0
    i only write the input & output message plus the file.... i don't know how to right the array with file plus the sequential please help me....
     
  5. someonesdad

    Senior Member

    Jul 7, 2009
    1,585
    141
    It's a simple loop using the rand method.
     
Loading...