SunQuest
 
           C/C++ Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingC/C++ Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old March 15th, 2004, 06:43 PM
eins2004 eins2004 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 2 eins2004 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Can someone help me with this C++ Program

I am a student and i am learning C++. Can someone help me do this program. I have no idea really where to start.

The instuctions are:

Write a program that simulates the rolling of two dice. The program should use rand to roll the first dice and should use rand
again to roll the second dice. The sum of the two values should then be calculated. [note: each dice can show an integer value from 1-6, so the sum of the two values will vary from 2-12, with 7 being the most frequent sum and 2 and 12 being the least frequent sums] Your program should roll the dice 36,000 times. use a single array to tally the numbers of times each possible sum appears. Print the results in a tabular format. Also, determine if the totals are reasonable (i.e. there are six ways to roll a 7, so approximately one sixth of the rolls should be 7).

Reply With Quote
  #2  
Old March 15th, 2004, 06:45 PM
eins2004 eins2004 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 2 eins2004 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by eins2004
I am a student and i am learning C++. Can someone help me do this program. I have no idea really where to start.

The instuctions are:

Write a program that simulates the rolling of two dice. The program should use rand to roll the first dice and should use rand
again to roll the second dice. The sum of the two values should then be calculated. [note: each dice can show an integer value from 1-6, so the sum of the two values will vary from 2-12, with 7 being the most frequent sum and 2 and 12 being the least frequent sums] Your program should roll the dice 36,000 times. use a single array to tally the numbers of times each possible sum appears. Print the results in a tabular format. Also, determine if the totals are reasonable (i.e. there are six ways to roll a 7, so approximately one sixth of the rolls should be 7).

Reply With Quote
  #3  
Old March 16th, 2004, 05:26 AM
Spongy's Avatar
Spongy Spongy is offline
Alternately High
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Hilversum, Netherlands
Posts: 223 Spongy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 56 m 41 sec
Reputation Power: 5
Send a message via MSN to Spongy
A little impatient here?
Posting your own text 2 times in 2 minutes is not gonna help you... Be patient and just wait until someone takes the time to help you with your problem. Read the forum rules before posting.
__________________
Work to live, don't live to work

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingC/C++ Help > Can someone help me with this C++ Program


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway