Little Help Please

This is a discussion on Little Help Please within the C++ Programming forums, part of the General Programming Boards category; I am looking to write the following selection statement to display “Overpriced” if the value of price is greater than ...

  1. #1
    Little Help
    Guest

    Little Help Please

    I am looking to write the following selection statement to display “Overpriced” if the value of price is greater than .99 and “Acceptable” if the value of price is less than or equal to.99.
    Can someone please help me out

    Thanks

  2. #2
    Registered User
    Join Date
    Oct 2002
    Posts
    291
    What have you done so far ?

  3. #3
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  4. #4
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    Code:
    float price;
    
    price=GetPriceSomeHow();
    
    if (price>.99)
      cout << "Overpriced" << endl;
    else 
      cout << "Acceptable" << endl;
    Wow. I haven't written such skillfull code for a long time!

    EDIT: Ints dont have decimal points
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21