Results 1 to 7 of 7

Thread: [resolved]

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Posts
    6

    [resolved]

    Code:
    #include <iostream.h>
    typedef short int si;
    
    int main()
    {
    	si theShoe = 20;
    	si theTie, theWatch;
    	cout << "enter the price for your watch\n";
    	cin >> theTie;
    	cout << "Enter a price for your tie\n";
    	cin >> theWatch;
    	{
    	if ( (theTie >= theWatch) && ( (theTie + theWatch) > theShoe) )
    		cout << "the shoe is less then the watch and the tie combined\n";
    	else 
    		if ( (theTie == theWatch) || ((theTie + 10) == theWatch) )
    			cout << "the tie is either worth as much as the watch or the tie is 10$ more then the then watch\n";
    		return 0;
    	}
    }
    Ok when it asks for me to type in the price of the tie and watch if I type in 11 then it will print the shoe is less then the watch... but if I type in something else wher eit makes the statement true it will not print the shoe is less then the watch.

    Can anyone tell me what I have done wrong or something I can do to fix it please

    Thanks,
    Bb
    Last edited by Bebo; Nov 17th, 2002 at 11:41 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width