14 Topics
|
|
How would I implement the rand or the srand statement into this C Programming language. I have been reading about these 2 statements but I am a bit confused still. In need of assistance. I am a beginner in Programming.... #include <stdio.h> //Main header #include <stdlib.h> //Standard header tells the … |
|
Hi everybody, I really tried to do my assignment but I am lost . Any helping is very helpful , Thanks Write a program that will generate a set of 50 random integers in the range -20 to + 20. The program should display the following: a) The number of … |
|
Hi guys, I'm trying to use the random number generator as part of the GSL library and it is working fine for a few hundred 'rounds' of my code (it is used quite a few times per round) but then i get an error message in the command window: [CODE]gsl: … |
|
I am having trouble correcting the syntax on this problem so far and I can't seem to find my mistake any ideas on what I am doing wrong ? The object of the program is to ask user for amount of money to put in the pot, and play until … |
|
i want to make random numbers for x[row][col] that row =10 and col =10, but my problem is: how i fix random numbers of n[col]=5; here is my code: public static void main(String[] args){ double[][] x= new double[10][10]; int row,col; int n[]={0,0,0,0,0,0,0,0,0,0}; for(row=0; row<10; row++ ){ for(col=0; col<10; col++){ if( … |
|
Hi all. It's been a while since I last worked with PHP. Hope someone can help me with this, because a few things aren't working :( First thing first. I'm doing an expense tracking system. User will be able to track their spendings according to month and year. Since it's … |
|
I have an assignment to make a craps game in c. The program i wrote runs but it always ends before it should. I think that the while loops in main have a problem but im not exactly sure wat the problem is because ive reviewed this code over and … |
|
Hi clever people, I need some help making a VB application which chooses a random line for a file, sets it as the value of a Label (word) and also adds it to a ListBox (list) when a Button (nextbut) is pressed. I also want it to keep going. Button; … |
|
My problem is, I've just started with C# and i was given a problem to solve by my teacher... here is the code... [CODE] { class Program { static void Main(string[] args) { int[] a = new int[20]; Random rand = new Random(); for (int i = 0; i < … |
|
I am new to C# and have encountered a problem with the following if statement... [CODE]measurement = GetRandomInt(0, 2); measurement2 = GetRandomInt(0, 2); if ((measurement == 1) || (measurement2 == 1)) q3correct = 1; else q3correct = 0;[/CODE] The statement works around 80% of the time and i have checked … |
|
I am using Visual Studio 2010 and C#. I am having problems making my three dice generate different random numbers. All of the dice roll at the same time. I have pictures of dice that I want to pull up for each of 3 dice according to what random number … |
|
Hi all, I was wondering if someone could help me with this bit of coding. I have set two veriables d1 and d2 to pick a random int of 1 to 10: which I need for in loop but when I run it the same number appear How do I … |
|
Hey, I'm new to Python and wondering about the following bit of code. It tells me that the module random has no attribute randint. I've looked at the documentation and such and I think I'm doing it correctly, but obviously something's wrong. Any ideas? Thanks! [code] import random int1=random.randint(1, 6) … |
|
Hello I have a > b(for example) I need to generate random number x that belongs from a to b for example a = 9, b = 16 x has to be x > 9 and x < 16 I use cstdlib.. but can't guess how to do it (using … |
The End.