Sponsored Links


Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: CS 201 Assignment # 2 Solution idea Spring 2011

  1. #1
    Junior Member Pari ch's Avatar
    Join Date
    Mar 2011
    Posts
    24

    Icon16 CS 201 Assignment # 2 Solution idea Spring 2011

    Sponsored Links1



  2. #2
    Administrator Xpert's Avatar
    Join Date
    May 2010
    Location
    Jhelum
    Posts
    6,239
    oright. where is the assignment?

  3. #3
    Junior Member Pari ch's Avatar
    Join Date
    Mar 2011
    Posts
    24

    Icon16 solution of CS 201 Assignment no 2 urgently needed plz plz

    Quote Originally Posted by Xpert View Post
    oright. where is the assignment?
    check the attachments
    thanks
    Attached Files Attached Files

  4. #4

  5. #5
    Junior Member
    Join Date
    Apr 2011
    Posts
    4
    plz snd me solution

  6. #6
    Administrator Xpert's Avatar
    Join Date
    May 2010
    Location
    Jhelum
    Posts
    6,239
    prince g. i told you that it will be here. just wait. working dear. light nay buhat tang keya howa hai.

  7. #7
    Junior Member
    Join Date
    Nov 2010
    Posts
    17
    aslamo elakum bhai cs 201 ki asignment 2 man help chahye

  8. #8

  9. #9
    Dear Mr. Xpert, Solution required for CS201 Assignment # 2.
    Thanks

  10. #10
    Junior Member
    Join Date
    Jan 2011
    Location
    punjab
    Posts
    8
    #include <iostream>
    #include <iomanip>
    using namespace std;
    void fill(int[][3]);
    void print(int[][3]);
    void printa(int[]);
    void combine(int[][3],int[][3],int[]);
    int main()
    {int a[3][3],b[3][3],c[18];
    cout"Matrix a\n";
    fill(a);
    cout"Matrix b\n";
    fill(b);
    cout"Matrix a\n";
    print(a);
    cout"Matrix b\n";
    print(b);
    combine(a,b,c);
    cout"The sorted merged array\n";
    printa(c);
    system("pause");
    return 0;
    }
    void printa(int a[])
    {int i;
    for(i=0;i<18;i++)
    coutsetw(4)a[i];
    coutendl;
    }
    void fill(int a[][3])
    {int i,j;
    cout"Enter the elements of the matrix :\n";
    for(i=0;i<3;i++)
    for(j=0;j<3;j++)
    {cout"Enter element ["i"]["j"]: ";
    cin>>a[i][j];
    }
    }
    void print(int a[][3])
    {int i,j;
    for(i=0;i<3;i++)
    {for(j=0;j<3;j++)
    coutsetw(4)a[i][j];
    cout"\n";
    }
    cout"\n";
    }
    void combine(int a[][3],int b[][3],int c[])
    {bool atemp[3][3]={false};
    bool btemp[3][3]={false};
    int i,j,upto=0,it,jt,in,max;
    for(upto=0;upto<18;upto++)
    {
    max=-99999;
    for(i=0;i<3;i++)
    for(j=0;j<3;j++)
    if(!atemp[i][j])
    if(a[i][j]>max)
    {max=a[i][j];
    it=i;
    jt=j;
    in=0;
    }
    for(i=0;i<3;i++)
    for(j=0;j<3;j++)
    if(!btemp[i][j])
    if(b[i][j]>max)
    {max=b[i][j];
    it=i;
    jt=j;
    in=1;
    }
    c[upto]=max;
    if(in==0)
    atemp[it][jt]=true;
    else
    btemp[it][jt]=true;
    }
    }

Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 06-21-2011, 05:26 PM
  2. Replies: 0
    Last Post: 06-10-2011, 05:00 AM
  3. Replies: 0
    Last Post: 05-27-2011, 11:14 PM
  4. Replies: 1
    Last Post: 04-19-2011, 04:50 AM
  5. Replies: 0
    Last Post: 04-13-2011, 09:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
-: Vuhelp Disclaimer :-
None of the files shown here are hosted or transmitted by this server. The links are provided solely by this site's users. The administrator's or staff of Vuhelp.net cannot be held responsible for what its users post, or any other actions of its users. You may not use this site to distribute or download any material when you do not have the legal rights to do so. It is your own responsibility to adhere to these terms. If you have any doubts about legality of content or you have any suspicions, feel free to contact us.
Online Education | JhelumSoft