CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Threaded View

  1. #1
    Join Date
    Oct 2011
    Posts
    1

    Post Person/Name Database

    I have tried to create a program where the user inputs a name and then it calls upon a function to report data about that person's name. I just wasn't sure how to properly call upon just 1 person's name instead of all of them. I only have 2 examples so far. These names are fake and maid up by the way. This program is just for fun and for learning. Sorry if I posted in the wrong forum or anything like that, this is my first post

    So far my code is:


    #include <cstdlib>
    #include <iostream>
    #include <cmath>
    #include <string>

    void Liz_Jacobin(int);

    void Jake_Jones(int);

    using namespace std;

    int main()
    {
    string name;
    int a;
    int call;
    int password;
    system("color 0A");

    cin >> name;
    cout << "The person you have requested info about is ";
    cout << "[";
    cout << name;
    cout << "]";
    cout << endl;
    cout << "Enter you administer password ";
    cin >> password;
    cout << endl;
    cout << endl;
    cout << "Your data includes";
    cout << endl;
    name = a;
    if (a == Liz_Jacobin)
    Liz_Jacobin(call);

    if (a == Jake_Jones)
    Jake_Jones(call);

    cout << endl;

    system("pause");
    return 0;
    }

    void Liz_Jacobin(int x)
    {
    string data;
    using namespace std;
    data = "Liz is a girl ";
    cout << data;
    cout << endl;
    }

    void Jake_Jones(int x)
    {
    string data;
    using namespace std;
    data = "Jake plays soccer ";
    cout << data;
    cout << endl;
    }
    Attached Files Attached Files

Tags for this Thread

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured