Need help with my code
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Need help with my code

  1. #1
    Join Date
    Nov 2012
    Posts
    2

    Need help with my code

    I keep getting an error on my code. It is for my C# class, but this is C++ code. Any help would be great.

    Thanks in advance

    Here is what I have:

    I am not sure what I am missing or doing wrong but I am getting errors. Any help would be great. It is for my C# programming class, my friend said it looks like a C++ program though. Here is what I have:



    #include<iostream>

    #include<string>

    #include<iomanip>

    using namespace std;

    void DisplayApplicationInformation();

    void DisplayDivider(string);

    string GetInput(string);

    void TerminateApplication();

    int main()

    { string input,name;

    int age;

    double mileage;

    DisplayApplicationInformation();

    DisplayDivider("Start Program");

    DisplayDivider("Get Name");

    cout<<"Your age is:"<<name<<endl;

    DisplayDivider("Gas Mileage");

    mileage=atof(input.c_str())

    count<<"Your car MPG is:"<<setprecision920,fixed<<mileage<<endl;

    TerminateApplication()

    system("pause");

    return 0;

    }

    void DisplayApplication()

    {cout<<"Welcome the Basic User Interface Program\n";

    cout<<"CIS247,Week 1 Lab\n";

    cout<<"Name:Your Name\n";

    cout<<"This prgram accepts user input as a string, then makes the apprpriate data conversion\n\n";

    }

    void DisplayApplicationInformation()

    {cout<<"Welcome the Basic User Interface Program\n";

    cout<<"CIS247,Week 1 Lab\n";

    cout<<"Name:Your Name\n";

    cout<<"This program accepts user input as a string then makes the appropriate data conversion\n\n";

    }

    void DisplayDivider(string outputTitle)

    {cout<<"**************,,output Title<<****************\namespace";

    }

    string GetInput(string inputType)

    {string GetInput(string inputType,,"";

    cin>>strInput;

    cin>>strInput;

    return strInput;

    return strInput;

    }

    void TerminateApplication()

    {cout<<"Thank you for using the Basic User Interface program\n";

    }

    }

  2. #2
    Join Date
    Apr 1999
    Posts
    27,446

    Re: Need help with my code

    Quote Originally Posted by Marques951 View Post
    I keep getting an error on my code. It is for my C# class, but this is C++ code.
    Please use code tags when posting code. No one is going to read a double-spaced, unformatted, post.

    Second, you need to be more specific as to the "error". A compile error? A link error? A runtime error?

    Regards,

    Paul McKenzie

  3. #3
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,231

    Re: Need help with my code

    Paul's right, your formatting is unreadable. However, the compiler gave me some pretty specific and easy to understand error messages. What are you confused about?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center