Thread: Little Help Please

  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
    [email protected]
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

Popular pages Recent additions subscribe to a feed