Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,132 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,792 people online right now. Registration is fast and FREE... Join Now!




puesdocode assistance

 
Reply to this topicStart new topic

puesdocode assistance, i have my program but i dont no where to start

missie
12 Apr, 2007 - 02:03 AM
Post #1

New D.I.C Head
*

Joined: 9 Apr, 2007
Posts: 3


My Contributions
for a program i wrote i am still very new at this i need just a push in the right direction please
i had to write a program that tests the effectiveness of this algorithm
start by initalising 10 variables i used as counters to zero.generate a large number of puesodorandom integers between 0 and 9 use the counterts to keep a sum of the occurance of each random digit print out the number of 1s 2s etc that occured and the percentage they occured.
for some reason (i was asked)to include in the begginning to get user to input a value 4 digits not divisable by 2 or 5 i hope that is enough info

User is offlineProfile CardPM
+Quote Post

NickDMax
RE: Puesdocode Assistance
12 Apr, 2007 - 06:05 AM
Post #2

2B||!2B
Group Icon

Joined: 18 Feb, 2007
Posts: 2,858



Thanked: 49 times
Dream Kudos: 550
My Contributions
Well I would start by defining an array of 10 integers (the "counters"). This way when you get a certain digit you just need array[digit]++ You will also need to keep track of a how many numbers are generated... this could be a counter itself or, since you will just be in a loop, just make sure you define a constant for number of digits you will produce.

The last part translates (to me) to getting the user to enter a number between 1000 and 9999 that such that (num % 2)!=0 && (num % 5)!=0.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/1/08 10:26PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month