I know that im not supposed to write like this but i just want to know how to sort 4 random chosen numbers (chosen by pc) in ascending order. Just the basic insert. Imstill abeginnerand cant use arrays!
You don't know how to use arrays, or you aren't allowed to use arrays? There is a big difference, and the answer drastically changes the required algorithm(s). Someone might help you if you answer that, and take some time to think about your algorithm.
using namespace std;
int argc, char* argv)
cout << "How many times would you like to roll the dice?" << endl;
cin >> numRolls;
for (int k = 0; k < 6; k++)
arrRolls[k] = 0;
for (int i = 1; i <= numRolls; i++)
dieRoll = DICE_ROLL();
cout << "Die Roll " << i << ": " << dieRoll << endl;
arrRolls[dieRoll - 1]++;
for (int j = 0; j < 6; j++)
cout << "The number " << j + 1 << " was rolled " << arrRolls[j] << " times." << endl;
result = (rand() % 6) + 1;
Edited 6 Years Ago by WaltP: Added CODE tags -- with all the help about them, how could you miss using them????
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...
OK, so HostGator for some reason no longer allows gcc/g++ access unless you have a Designated Server account, which is a lot of money to spend just to compile my "Hello World" program. Thus I figured I'd compile at home, then upload. Program is your regular old bare-bones Hello World ...