Debug Conversion program

This is a discussion on Debug Conversion program within the C++ Programming forums, part of the General Programming Boards category; Could someone pleasee help me debug this program..Its for converting meters-cm to ft-inches and vice versa and adding the 2... ...

  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    1

    Debug Conversion program

    Could someone pleasee help me debug this program..Its for converting meters-cm to ft-inches and vice versa and adding the 2...
    __________________________________________________ _________________
    Code:
    #include
    #include
    class db;
    class dm
    {
    float m;
    public:
    void getdata()
    {
    cout<<"\nEnter the distance in meters-centimeters:";
    cin>>m;
    }
    void display(dm b)
    {
    cout<<"\nTotal distance in meters-centimeters:"<>f;
    }
    void display(db d)
    {
    cout<<"\nTotal distance in feet-inches:"<meters-centimeters"<<"\n2>feet-inches";
    cin>>n;
    switch (n)
    {
    case 1: b=add(a,c);
    b.display(b);
    case 2: d=sum(a,c);
    d.display(d);
    }
    cout<<"\nDo you want to continue?";
    cout<<"\nPress 1 if yes\n";
    cin>>y;
    }while(y==1);
    getch();
    }

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,258
    Moved to C++ Programming.

    You should fix your posted code so that it is compilable. You should also post it with proper indentation. Oh, and you should describe the problem that you are facing.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    812
    It seems to me you just copied some random code, you don't even have an int main().

    You should learn at least the basis of the language before trying to compile anything.

    cout<<"\nEnter the distance in meters-centimeters:";
    Its either meter or centimeter, not both.
    Compiler MSVC++ 2013 with Code::Blocks.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program Plan
    By Programmer_P in forum C++ Programming
    Replies: 0
    Last Post: 05-11-2009, 02:42 AM
  2. Program Conversion Help
    By magda3227 in forum C Programming
    Replies: 6
    Last Post: 06-13-2008, 02:24 PM
  3. Minute to hour/minute conversion program
    By Remius in forum C Programming
    Replies: 7
    Last Post: 12-29-2007, 08:39 AM
  4. program conversion.
    By nesagsar in forum C++ Programming
    Replies: 4
    Last Post: 12-14-2006, 04:04 PM
  5. BOOKKEEPING PROGRAM, need help!
    By yabud in forum C Programming
    Replies: 3
    Last Post: 11-16-2006, 11:17 PM

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