0

Hi I am having a problem in the sixth edition on starting out with C++ programming. I need the full code of how to do it cause I am getting errors and dont know what I am doing.

The question ask.Write a funtion named coinToss that simulates the tossing of a coin. When you call the function, it should generate a random number in the range of 1 through 2. If the random number is 1, the function should display "heads." If the random number is 2, the function should display "tails." Demonstrate the function in a program that asks the user how many times the coin should be tossed, and then simulates the tossing of the coin that number of times.

Ty for your help!!

6
Contributors
8
Replies
9
Views
7 Years
Discussion Span
Last Post by Narue
Featured Replies
  • 1

    [QUOTE]I need the full code of how to do it[/QUOTE] You would never get full code here. Google is your friend. Here is a nice article here on Daniweb about generating Random Numbers:[url]http://www.daniweb.com/forums/thread1769.html[/url] Off-Topic "Laughter Laughter, Laughing at my cries" Read More

  • 2
    WaltP 2,905   7 Years Ago

    Because we already got our grades and passed the course. You can't pass using our work. You need to pass on your own work. Read More

  • 1
    Narue 5,707   7 Years Ago

    This thread is being closed due to violation of Daniweb's homework policy. Read our rules, try it yourself, and then create a new thread if you need help (help != handouts, by the way). Read More

0

I need the full code of how to do it cause I am getting errors and dont know what I am doing.

Post what you have done so far

0

Try at least doing some effort, post the code you have so far ...
You'll never learn to program if you aren't writing programs yourself ...

0

Well I just joined this class late so I dont know what I am doing whatsoever so I needed this code to get my first grade.

-3

But why cant you just give me the code?

Comments
what they said
if you cant generate a simple random number then you really are on the wrong course
Get real, bozo. Stop begging and read your **** book.
2

Because we already got our grades and passed the course. You can't pass using our work. You need to pass on your own work.

Comments
Well said :)
Well said
1

This thread is being closed due to violation of Daniweb's homework policy. Read our rules, try it yourself, and then create a new thread if you need help (help != handouts, by the way).

Comments
The granite fist in the velvet glove comes down on another dead-end "gimme the answer" thread
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.