none
Can someone help me with my code.

    Question

  • I'm new at C++ and i've run an error list but i'm not sure what else is. Here's my code.

    //Specification: Display a menu

    //Find Errors in this program

    #include

     

     

     

     

    <iostream>

    main ()

    {

    cout <<

     

    "Choose From Martha's Menu:/n";

    cout <<

     

    "1 - Dinner"

    cout << endln << 2 -

     

    "Lunch:";

    cout << endln <<

     

    "3 - Breakfast";

    cout <<

     

    "Enter a number:"

    int

     

     

     

     

    Choice = 0;

    cin >> choice;

    cout <<

     

    "\n You Choose " << choice;

    return

     

     

     

     

    0;

    }

    Thursday, October 29, 2009 4:27 PM

Answers

  • endln doesn't exist. endl does.


    cout << "1-Dinner" << endl << "2-Lunch" << endl .... ;


    cout << "Enter a number"; 

    • Proposed as answer by Nikita Leontiev Thursday, October 29, 2009 5:18 PM
    • Marked as answer by Wesley Yao Monday, November 02, 2009 5:17 AM
    Thursday, October 29, 2009 4:32 PM

All replies

  • endln doesn't exist. endl does.


    cout << "1-Dinner" << endl << "2-Lunch" << endl .... ;


    cout << "Enter a number"; 

    • Proposed as answer by Nikita Leontiev Thursday, October 29, 2009 5:18 PM
    • Marked as answer by Wesley Yao Monday, November 02, 2009 5:17 AM
    Thursday, October 29, 2009 4:32 PM
  • And after #include <iostream>, please add: using namespace std; to use the cin, cout and other members in the namespace.

    Sincerely,
    Wesley
    Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, November 02, 2009 5:17 AM