Forum: C Nov 9th, 2008 |
| Replies: 2 Views: 466 Some C compiler will give you a warning when your main function does not return an integer.
In this case, do the following changes to the main function:
int main()
{
......
......
return... |
Forum: C Nov 6th, 2008 |
| Replies: 1 Views: 312 Seeing you have made some efforts in coding it yourself, I will take the trouble to go through your long post.
Here are the problems:
1. Initialize all your marks and counters when you declare... |
Forum: C++ Oct 22nd, 2008 |
| Replies: 2 Views: 897 Where did you assign the value for variable num? |
Forum: C++ Oct 21st, 2008 |
| Replies: 8 Views: 521 If there's no further issue, please mark the thread as solved. :) |
Forum: C++ Oct 21st, 2008 |
| Replies: 3 Views: 371 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: 371 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: 521 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: IT Professionals' Lounge Oct 17th, 2008 |
| Replies: 7 Views: 1,122 I know it isn't free, but does Visio suits your purpose? Or even MS Word can be used to draw blocks and arrows, if that is what you want. |
Forum: C++ Oct 17th, 2008 |
| Replies: 18 Views: 1,708 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,708 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: 422 You can also convert the integer into a string, and then retrieve the particular nth placed digit of the string. |
Forum: C Oct 10th, 2008 |
| Replies: 7 Views: 787 First parameter is wrong. Use char* instead of char. Are you going to change the value of those variables inside the function? If so, pass pointers or reference, else you can simply pass by values. |
Forum: C++ Oct 9th, 2008 |
| Replies: 7 Views: 551 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 8th, 2008 |
| Replies: 6 Views: 619 What language you use? What's your level of proficiency? And how much time you have? |
Forum: C++ Oct 6th, 2008 |
| Replies: 12 Views: 1,066 You still don't get it.
It should be:
ticketstotal - moneyprizes - (ticketstotal * percentticket/100.) |
Forum: C++ Oct 5th, 2008 |
| Replies: 12 Views: 1,066 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,066 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,531 I believe you need to use recursive functions. |
Forum: C Oct 3rd, 2008 |
| Replies: 8 Views: 2,159 When you are using the printf function:
printf("%s", a);
The function is treating variable "a" as a pointer to the beginning of a stream of characters. However, it doesn't have the... |
Forum: C++ Oct 3rd, 2008 |
| Replies: 12 Views: 1,066 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: 681 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: 681 Please see my solution above. |
Forum: C++ Oct 1st, 2008 |
| Replies: 9 Views: 681 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... |