![]() |
| ||
| Need some help for a randomize code Hello DaniWeb members, I need some help with a program I made that I couldn't figure out the logic to complete the program should make 5 random numbers between "1 and 55" and those five numbers should: *Have two or three even numbers (%66 even or %66 odd) *Have two or three numbers higher than 28. *the sum of all five numbers should be between 106 and 179 *Choose one two numbers from the same level "and not choose two levels "total of level chosen 4" Level 1 1 : 9 Level 2 10: 19 Level 3 20: 29 Level 4 30: 39 Level 5 40: 49 Level 6 50: 55 I did make the program work where it should all the results, but couldn't figure how I could force the program to do the outputs I'm looking for. here is a sample of the output I'm looking for http://img511.imageshack.us/img511/7...eenshotoo6.png any ideas? thanks Hassan // PROJECT1.cpp : Defines the entry point for the console application. |
| ||
| Re: Need some help for a randomize code Here are my functions 1- To count even numbers #include "stdafx.h" 2- To count numbers higher than 28 #include "stdafx.h" 3- To count numbers from level1 #include "stdafx.h" 4- To count numbers from level2 #include "stdafx.h" 5- To count numbers from level3 #include "stdafx.h" 6- To count numbers from level4 #include "stdafx.h" 7- To count numbers from level5 #include "stdafx.h" 8- To count numbers from level5 #include "stdafx.h" and for the libraries I added those under "stdafx.h": #include <iostream> #include <ctime> using namespace std; |
| All times are GMT -4. The time now is 11:19 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC