Results 1 to 2 of 2

Thread: [Help] array for my assignment

  1. #1
    Addicted Member
    Join Date
    Jan 08
    Posts
    179

    Post [Help] array for my assignment

    how to solve this problem?
    please help!

    #include<iostream.h>
    #include<conio.h>

    void main()
    {

    int acct;
    char name[50];
    char add[50];
    int opt;
    int index=0;

    clrscr();

    do{
    cout<<"Menu"<<endl;
    cout<<"1 add"<<endl;
    cout<<"2 view"<<endl;
    cout<<"3 exit"<<endl;
    cout<<"Choice: ";cin>>opt;

    switch(opt)
    {
    case 1:
    clrscr();
    cout<<"Enter Account: ";cin>>acct[index];
    cout<<"Enter Name: ";cin>>name[index];
    cout<<"Enter Add: ";cin>>add[index];
    index++;
    break;

    case 2:
    clrscr();
    cout<<"Entered Data------"<<endl;
    for(int a=0;a<index;a++)
    {
    cout<<acct[a] <<"\t" <<name[a] <<"\t" <<add[a]<<endl;
    }
    break;

    case 3:
    cout<<"Exit";
    break;
    }

    }while(opt!=3);
    getch();
    }

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 05
    Location
    Sweden
    Posts
    8,013

    Re: [Help] array for my assignment

    You have not posted a problem definition. Even if you had, why would someone else spend time doing your homework?
    ---My Flickr photo (mostly screenshots these days!) stream. Have a look!

    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    TCP client/server connection | Retrieving the EventHandler for any Event by code.
    Check out the work in progress: Vortex - C++ 3D Game engine for windows and linux - (Development blog - Leave a comment!)

Posting Permissions

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