TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
John
NA
3
0
Generating random numbers and percentages of numbers
Nov 30 2010 12:51 AM
The issue that I'm having is how to randomly generate the a random number and then randomly distribute the product over 10 variables. The product of all 10 percentage variables should equal 100% of the total given in the first random function.
Here's an example of what I mean:
x= randomly generated number from 10000-25000
a=(random)% of x
b=(random)% of x
c=(random)% of x
d=(random)% of x
e=(random)% of x
f=(random)% of x
g=(random)% of x
h=(random)% of x
i=(random)% of x
j=(random)% of x
x=sum(a,b,c,d,e,f,g,h,i,j)=100% of x
The result only requires a number greater than 0 and repeated percentages are not a problem as long as they are randomly generated.
Thanks for any input, I'm still learning C# after a long recess from C++
Reply
Answers (
3
)
BACKUP AND RESTORING DATABASE USING C#
how to export datagridview to word in windows application