Results 1 to 2 of 2

Thread: [Help] array for my assignment

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2008
    Posts
    209

    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 2005
    Location
    Sweden
    Posts
    8,018

    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?
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

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