~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Stay together for the kids - Blink 182

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

we have got.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

AMD - Texas Instruments

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

IMMENSE towers of France carry malodorous socks while becoming famous monuments.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

try to squash

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You get dissolved.

I put in a geeky geek.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

potato - chips

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

> how can another class interact with class employee e.g class doctor?
One class interacts with another classes by means of object instances. You can always pass on object instance of one class to the member function of another class. In fact we do this all the time without even realizing it:

// here str is a object instance of class string
string SomeClass::modifyString (string str)
{
   // process
   return str;
}

> How is it possible to improve an object of a class?

What do you exactly mean by this ? Maybe the generalization and specialization relationship. Consider for example an Account class.

An Account class is the generalization of Savings, Fixed and Current account types (a fixed account is a type of Account). On the other hand a FixedAccount class is a specialization of the generic class Accounts.

Thus the Savings class will have data members which the Fixed account might not have but they all will definately contain the members of their super class Account depending on the access specifiers specified and so on. (public, private, protected)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

XXX for me... :D

BTW, INTP here.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

But the question here is, why not just erase it ? Is it a requirement ? BTW, you can get all the reference to vector methods here.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Read the links posted by me in the second post.

An eg.

string inStr;
string searchFor = "hello";
ostream in ("test.txt");

while (getline (in, inStr))
{
    if (inStr == searchStr)
    {
        //process
    }
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Check if the distance between the center of your square and the random point is less than equal to the radius. If so then the dart has hit the spot otherwise its a miss. This validation should be easy to perform using the distance formula.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Try using the erase method of vectors instead of popping them. Read this.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Hey there my friend, welcome to Daniweb :D

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Just replace the ++current in my previous code with current += 2 and make the data type of the variable value as double and you should be good to go.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

scorch

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

It becomes a part of the biggest catapult in this world.

I put in dying dreams.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Last train home - Lost Prophets

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

fears - death god

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Well is from where we draw water.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

the worse of

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Smelly towers of France carry malodorous SOCKS while becoming famous footwear.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

all is lost

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Maybe something like this:

double factorial (double value)
{
    double result = 1.0;
    while (fabs (value) > 0)
    {
        result *= value--;
    }
    return result;
}

int main ()
{
    double summand = 0.0, sum = 0.0;
    int value = 0, current = 0;
    bool flag = true;

    cout << "Enter the power of e whose answer you want: " ;
    cin >> value;
    getchar ();

    do
    {
        summand = pow ((double)value, (double)current) / factorial (current);
        if (flag)
            sum += summand;
        else
            sum -= summand;

        flag = !flag;
        ++current;
    }
    while (summand > 0.00001);
    cout << "\nAnswer is : " << sum;

    getchar ();
    return 0;
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I still see a while loop in your code. On top of that the while loop uses the value of i which is 5 when the while block is entered (since you never reset it after the for loop).

Stop checking for the occurance of zero in the loop. Just make it like the loop you used for accepting user input.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You are welcome. :D

Thread solved.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

The alteration is happening alright. Your logic is wrong. Look at it once again. Are you sure you are doing what the equation demands ?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Some good links for File processing in C++ are here, here and here.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Maybe you need to look a bit harder at the code I posted. It takes care of changing the flag variable. Look out for the part posted in bold...

John A commented: Rep for a hard-working (and patient!) moderator... --Joe(y) +8
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

All famous compilers come with a host of features and some kind of IDE. If minimalism is what you want, you can go for command line compilers but they just end up sucking your blood if you haven't used them before.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Good, then go for WinAPI.

A good starting place would be this and the MSDN if you get stuck.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Keep a flag variable which will decide whether the operation should be addition or subtraction.

{
   double summand = 1;
   int n = 1;
   double sum = 1;
   bool flag = true;
   do
   {
      summand = summand * x / n;

[B]      if (flag)
           sum += summand;
      else
           sum -= summand;
      flag = !flag;[/B]

      n--;
   }
   while (summand > 0.00001);

   return sum;
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Post what you attempted so far or start reading the stickies at the top of C++ forum to aid you in programming.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Some points:

1. Use code tags to post your indented code so that it is more readable.

2. The loop you use for input can easily cause buffer overflows if zero is not entered by the user. If you know the array size in advance, replace all the cumbersome while loops with the for loops and repost your updated code.

3. You did a mistake in placing the logic for finding out the highest in the else block. Place it in a seperate if block.

4. Initializing your variables will save you a lot of head banging in the future. Always initialize your variables before using them in such situations.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Some points:

• Post your code in code tags.

• Don't use gets for accepting input from the user. Read this.

• Remove the semicolon after the if statement in your function. Its ruining your logic.

• m = (char) str1; The above statement doesn't do what you expect it to do. It converts a address to character, something which you don't want here.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I challenge you to supply a satsifactory answer!

My friend, I hope you do realize this is no battle ground where we can challenge our friends to duel... ;)

I am working on a program that uses the graphics.h library functions
and the 0x33 mouse interrupt. When I click at a particular place on the
screen, the graphics nearby the mouse are saved and displayed on the
new screen (that appears due to the mouse click) when the mouse
position is changed. The same happens when I drag the mouse from one point to another.

You need to post the screenshots or atleast the code so that we can get an idea of how things currently stand.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You get to sculpt the Statue of Liberty.

I put in a headphone.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

happy - joy

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

The same old song and dance - Aerosmith

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Wonderwall - Oasis

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

a boon or

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

UK is where our Admin Davey lives. Do give him my best wishes when you meet him...

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Rainmaker - Iron Maiden

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

stark

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You get a larger than life drink.

I put in some charcoal.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Greek - geek

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Smelly slippers of France carry malodorous perfume while becoming famous footwear.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

the way we

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Its first time for you, not for us.

And btw, you already must have got the warning for not adding code tags. Remember to use them in the future.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Bumping your posts would do you no good. It would only result in a longer delay and is not encouraged. Patience wins the best help.

I dont get it , what do you mean by "diffrent variables to keep track of the indexes" ?can you give me an example ?
thanks.

You just have to make sure that the element you have to remove doesn't make it into the new array.

This depends on the way you want the removal to happen. For eg. you can do position based removal or value based removal.

And btw, are you sure you have to create a new array? Normally these kinds of exercises require you to make changes in the original array itself using realloc .