Display problem

This is a discussion on Display problem within the C++ Programming forums, part of the General Programming Boards category; When I run my program it asks for the food and drink total but after I enter the amount and ...

  1. #1
    Registered User Birdhaus's Avatar
    Join Date
    Nov 2005
    Posts
    11

    Display problem

    When I run my program it asks for the food and drink total but after I enter the amount and hit "enter" the program just ends. I just want a little help as to what I'm doing wrong please.
    Code:
    #include <iostream>
    
    using namespace std;
    
    int main()
    {
        double FDT;
        double tax;
        double tip;
        double GT;
        
        cout << "Enter the food and drink total:";
        cin >> FDT;
        
        tax = FDT*0.07;
        
        tip = FDT*0.18;
        
        GT = FDT + tax + tip;
        
        cout << "\n************************";
        
        cout << "\n*";
        
        cout << "\n*      Bill Calculation  ";
        
        cout << "\n*";
        
        cout << "\n* Food and drink total:" << FDT;
        
        cout <<"\n* Tax at 7%:" << tax;
        
        cout <<"\n* Tip at 18%:" << tip;
        
        cout <<"\n* Grand total:" << GT;
        
        return 0;
        
    }
    Thanks a lot for your help, greatly appreciated.

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  2. new problem with class
    By jrb47 in forum C++ Programming
    Replies: 0
    Last Post: 12-01-2006, 07:39 AM
  3. Replies: 2
    Last Post: 06-21-2006, 04:23 AM
  4. Display problem
    By RoD in forum C++ Programming
    Replies: 11
    Last Post: 10-09-2002, 05:25 PM
  5. display problem after retrieving from text
    By Unregistered in forum C Programming
    Replies: 3
    Last Post: 01-29-2002, 05:48 AM

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