Forum: C++ Oct 22nd, 2008 |
| Replies: 2 Views: 856 Where did you assign the value for variable num? |
Forum: C++ Oct 21st, 2008 |
| Replies: 8 Views: 512 If there's no further issue, please mark the thread as solved. :) |
Forum: C++ Oct 21st, 2008 |
| Replies: 3 Views: 368 There are some more problems with your codes:
1. You never initialized the variable "removed", yet you used it to keep track of the turns:
removed += turn; //Keep a running total of turns
... |
Forum: C++ Oct 21st, 2008 |
| Replies: 3 Views: 368 There are a number of ways to get out of the loop. One way is to put the break statement when someone wins the game:
if (left < 1)
{
cout << " Player 1, You have one the game!" << endl;
break;... |
Forum: C++ Oct 20th, 2008 |
| Replies: 8 Views: 512 Look at your line 60 and line 66. This is not the way you decrement the value.
You should do this:
STAMINA = STAMINA - 2;
or this:
STAMINA -= 2; |
Forum: C++ Oct 17th, 2008 |
| Replies: 18 Views: 1,654 Alright, I will comment base on your latest codes, cos I don't really have time to go through all the posts. Also, I will skip removeAt() function at this moment and focus on the rest.
1. At the... |
Forum: C++ Oct 16th, 2008 |
| Replies: 18 Views: 1,654 Are you sure your program runs fine? At the first glance, there's so many errors in it:
1. Your main function is passing uninitialized variables' values like index and insertItem into removeAt()... |
Forum: C++ Oct 15th, 2008 |
| Replies: 2 Views: 419 You can also convert the integer into a string, and then retrieve the particular nth placed digit of the string. |
Forum: C++ Oct 9th, 2008 |
| Replies: 7 Views: 546 No where in the question says you need to prompt the user. You can simply initialize Count to 1 before the while loop, and increment the value within the loop. |
Forum: C++ Oct 6th, 2008 |
| Replies: 12 Views: 1,060 You still don't get it.
It should be:
ticketstotal - moneyprizes - (ticketstotal * percentticket/100.) |
Forum: C++ Oct 5th, 2008 |
| Replies: 12 Views: 1,060 That's because you deducted the wrong thing. Instead of deducting the total admin overhead, you deducted the $2 admin fee!
This question is actually very straightforward, apart from the... |
Forum: C++ Oct 5th, 2008 |
| Replies: 12 Views: 1,060 What's the difficulty in calculating these two items? The first one is straight from the value the user entered, the second was just the total revenue deducting the admin fee & prize money.
... |
Forum: C++ Oct 3rd, 2008 |
| Replies: 6 Views: 1,491 I believe you need to use recursive functions. |
Forum: C++ Oct 3rd, 2008 |
| Replies: 12 Views: 1,060 The total admin charges is calculated as follows:
cout << percentticket/100. * ticketstotal << endl;
Remember to put a decimal point behind the 100 so that the resultant value becomes a... |
Forum: C++ Oct 1st, 2008 |
| Replies: 9 Views: 663 Switch the position of the two lines stated, as in:
#include <iostream>
#include <cstring>
using namespace std;
#include "SkipCard.h" |
Forum: C++ Oct 1st, 2008 |
| Replies: 9 Views: 663 Please see my solution above. |
Forum: C++ Oct 1st, 2008 |
| Replies: 9 Views: 663 There's a few problems to your codes.
Basically, to solve your error, you just have to interchange the below two lines:
#include "SkipCard.h"
using namespace std;
However, I believe the... |