Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
c++ Array
10-12-2013, 03:04 PM (This post was last modified: 10-26-2013 02:04 PM by ionutvmi.)
Post: #1
c++ Array
Code:
//Array
//add me on fb: [email protected]

#include<iostream>
#include<string>

using namespace std;

int main()
{
    int input,records,go,i,view,wat,x;
    string id[255];
    string name[255];
    int age[255];
    string section[255];
    


main:
    cout<<"[1]Input Records\n";
    cout<<"[2]View Record\n";
    cout<<"[3]Exit\n";
    cin>>i;
    

    switch(i)
    
case 1:
    {
    cout<<"Number of Records: \n";
    cin>>records;
    for (x=0; x<records; x++)
    {
        cout<<"StudentID: \n"<<endl;
        cin>>id[x];

        cout<<"Name: \n"<<endl;
        cin>>name[x];

        cout<<"Age: \n"<<endl;
        cin>>age[x];

        cout<<"Section: \n"<<endl;
        cin>>section[x];
        
    }

    system("cls");
    cout<<"[1]Go to Main\n";
    cin>>go;
    switch(go)
    case 1:
    {
    goto main;
    }

    }
    switch(i)

    case 2:
        {
            cout<<"View Records\n";
            cout<<"Student ID";
            cin>>wat;
            x= wat-1;

            cout<<"Studet Name: \n"<<name[x]<<endl;
            cout<<"Age: \n"<<age[x]<<endl;
            cout<<"Section: \n"<<section[x]<<endl;

        }











    return 0;
}
Find all posts by this user
Like Post Quote this message in a reply
[-] The following 1 user Likes Silvereight's post:
DjPsAllScript (08-13-2016)
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)