Thread: if/else statement C++ first time

  1. #1
    Registered User
    Join Date
    Nov 2001
    Posts
    9

    Question if/else statement C++ first time

    Price per gallon. Am a beginner in C++6.0 Just starting to learn.
    Exterior Interior
    1 to 3 Price = 16.75 Price is 16.26
    4 to 7 Price = 15.85 Price is 15.10

    there is more to this am just checking on how to write the if /and statementand .ok here goes.

    cout<<"Exterior Price ";
    cin>>exterior;
    cout<<"Interior Price ";
    cin>>interior;

    if(numberofgallonspaint<=3)
    {
    cout>>"Exterior Price<<endl;
    cout>>"numberofgallons<<total;
    }
    else
    {
    cout>>"Interior Price<<endl;
    cout>>"numberofgallons<<total;
    cout>>
    };


    Ok that's what I was thinking Please and Thank-you for your help.

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    9
    you're having troubles with extraction/insertion direction. Recheck you cout statements. your if/else statement seems to be ok, so what's the prob. ?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 26
    Last Post: 07-05-2010, 10:43 AM
  2. Representing floats with color?
    By DrSnuggles in forum C++ Programming
    Replies: 113
    Last Post: 12-30-2008, 09:11 AM
  3. Sending an email in C program
    By Moony in forum C Programming
    Replies: 28
    Last Post: 10-19-2006, 10:42 AM
  4. calculating user time and time elapsed
    By Neildadon in forum C++ Programming
    Replies: 0
    Last Post: 02-10-2003, 06:00 PM