cout << "Welcome to the Plinko simulator!" << endl << endl;
while (true)
{
cout << "Menu: Please select one of the following options:" << endl << endl;
cout << "0 - Quit the program" << endl;
cout << "1 - Drop a single chip into one slot" << endl;
cout << "2 - Drop multiple chips into one slot" << endl << endl;
cout << "Enter your selection now: ";
cin >> userInput;
cout << endl;
if (userInput < 0 || userInput > 2) {
cout << "Invalid selection. Please enter 0, 1 or 2" << endl << endl;
}
else {
if (userInput == 0) {
cout << "Goodbye!";
return 0;
}
else if (userInput == 1)
{
cout << "*** Drop a single chip ***" << endl << endl;
cout << "Which slot do you want to drop the chip in (0-8)? ";
cin >> slotNumber;
cout << endl;
else if (userInput == 2)
{
cout << "*** Drop multiple chips ***" << endl << endl;
cout << "How many chips do you want to drop (>0)? ";
cin >> numberOfChips;
cout << endl;
if (numberOfChips <= 0) {
cout << "Invalid number of chips." << endl;
}
else {
cout << "Which slot do you want to drop the chip in (0-8)? ";
cin >> dropofChips;
cout << endl;
if (dropofChips >= 0 && dropofChips <= 8) {
currentSlot = slotNumber;
for (int i = 0; i < BOARD_ROWS; ++i)
{
if (currentSlot == 8) {
currentSlot = currentSlot - CHIP_SHIFT;
}
For multiple slot, if I put 142 chips and slot 7, I am expecting to have 155700.00. But, I am not even close to get that number. Could you englighten me what I have to do?