https://www.google.com/contributor/welcome/?utm_source=publisher&utm_medium=banner&utm_campaign=2376261057261409

Search This Blog

Search with our Site

Custom Search

Thursday, April 26, 2012

CS201 Asignment # 2 Solution 2012

#include <cstdlib>
#include <iostream>

void high_Tenp(int [],int);

void low_Tenp(int []);

void Average_Tenp(int [],int);

using namespace std;

int main(int argc, char *argv[])
{
    
     cout<<"\t\t***********************************"<<endl
         <<"\t\t   TEMPRATURE CALCULATION SYSTEM      "<<endl
         <<"\t\t***********************************"<<endl<<endl;
int n;

cout<<"Enter the number of consecutive days to read their temperature : ";

cin>>n;
    
    
    
   int  x[n];
   
    int i, j, tmp;
            
for(i=0;i<n;i++)
{
                
cout<<endl<<"Enter temperature for day "<<i+1<<" : ";

cin>>x[i];
                
}

for(i=0; i<n; i++)
{

for(j=0; j<n-1; j++)
{
         
if (x[j] > x[j+1])  
{

tmp = x[j];

x[j] = x[j+1];

x[j+1] = tmp;

}

}

}

Average_Tenp(x,n);
    
high_Tenp(x,n);
    
low_Tenp(x);  

system("pause");

}

void high_Tenp(int a[],int arraysize)
{
  cout<<"The Higest Temprature is : "<<a[arraysize-1]<<endl;
}

void low_Tenp(int a[])
{
int b=0;
cout<<"The Lowest Temprature is : "<<a[b]<<endl;
}

void Average_Tenp(int a[],int arraysize)
{
     int i;
     
     double c=0;
     
     for ( i = 0 ; i < arraysize ; i ++)     
{
 c=c+a[i];
}
c=c/i;
cout<<endl<<"The Average Temprature is : "<<c<<endl;
}






 
void swap(int *x, int *y)   //function using pointers to interchange the values

{

     int tmp;

     if(*x > *y)

     {

           tmp = *x;

           *x = *y;

           *y = tmp;
           
           
}


}

CS101 Assignment No. 02 Semester: Spring 2012 Introduction to Computing


animatedLOGO
Assignment No. 02
Semester: Spring 2012
Introduction to Computing-CS101

Total Marks:   20

Due Date: 02-05-2012

Objective: To develop your own JavaScript functions and using them in form.

Instructions:
Please read the following instructions carefully before solving & submitting assignment:
Assignment should be in your own wordings not copied from internet, handouts or books.
It should be clear that your assignment will not get any credit (zero marks) if:

  • The assignment is submitted after due date.
  • The submitted assignment does not open or file is corrupt.
  • The assignment is copied (from other student or copied from handouts or internet).
  • Student ID is not mentioned in the assignment file or name of file is other than student ID.

For any query about the assignment, contact at cs101@vu.edu.pk

GOOD LUCK

 

Question 1         [20 marks]

Make a form in HTML document containing only one field named as Email and one Submit Button. Write your own JavaScript function to validate the email address.

The Validation should be as follows:

  1. It must accept only your VU Student email address i.e; it must not accept any other student’s VU email address.
  2. It must show alert on acceptance or denial of the email address after validation.
  3. The name of the function should contain your student ID like CheckEmail_BC102034568.
  4. If you enter your wrong student email id then it must show alert as well.
  5. It must accept your student ID only at vu.edu.pk, means if you enter BC102034568@hotmail.com then it must not accept it.
  6. There must be unique alerts for each error; like if the length of the student ID is larger or smaller than the original ID then the alert should be according to that.
  7. During each alert, the entered email address must also be shown in the alert box like: “BC102034560000008@vu.edu.pk is not your Valid Email address”

Hint: See the attached sample html file for simply checking @ and dot in an email address.


Note:

  • Assignment should be done by your own efforts, not copied from net, handouts or books.

  • You should submit your html file as well as word file containing the code, zip the both files in one single file and upload via your assignment interface.






Thursday, April 19, 2012

CS 502 Fundamental of Algorithms Assignment # 01 Spring 2012


CS 502 Fundamental of Algorithms
Assignment # 01
Spring 2012
Total Marks = 10+10 = 20
Deadline
Your assignment must be uploaded / submitted before or on April 23, 2012

Upload Instructions
Please view the assignment submission process document provided to you by the
Virtual University.

Rules for Marking
Please note that your assignment will not be graded if:
It is submitted after due date
The file you uploaded does not open
The file you uploaded is copied from someone else or from internet
It is in some format other than .doc

Note: Material that is an exact copy from handouts or internet would be graded
Zero marks. Your solution should consist of the material found through different sources and written in your own words.

Assignment Statements:
Question 1:
Consider sorting n numbers stored in array A by first finding the smallest element of A and exchanging it with the element in A[1]. Then find the second smallest element of A, and exchange it with A[2]. Continue in this manner for the first n - 1 elements of A. Write pseudo code for this algorithm, which is known as selection sort. What loop invariant does this algorithm maintain? Why does it need to run for only the first n - 1 element, rather than for all n elements? Give the best-case and worst-case running times of selection sort in Θ-notation.

Question 2:
We can extend our notation to the case of two parameters n and m that can go to infinity independently at different rates. For a given function g(n, m), we denote by O(g(n, m)) the set of functions

O(g(n, m)) = {f(n, m): there exist positive constants c, n0, and m0 such that 0 ≤ f(n, m) ≤ cg(n, m) for all n n0 and m m0}.

Give corresponding definitions for Ω(g(n, m)) and Θ(g(n, m)).

Monday, April 9, 2012

CS601 Assignment # 1 Spring 2012 (19-04-2012)



Assignment No. 1 
Semester Spring 2012
Data Communication - CS601

Total Marks: 15

Due Date: 19-04-2012

Objective: To understand the Network Topologies and some basic concepts of Data Communication.

Instructions:
Please read the following instructions carefully before solving & submitting assignment:
Assignment should be in your own wordings not copied from internet, handouts or books.
It should be clear that your assignment will not get any credit (marks) if:

  • The assignment is submitted after due date.
  • The submitted assignment does not open or file is corrupt.
  • The assignment is copied (from other student or copied from handouts or internet).
  • Student ID is not mentioned in the assignment file or name of file is other than student ID.

For any query about the assignment, contact at cs601@vu.edu.pk

GOOD LUCK

 

Q 1 Suppose you are installing a new network for a company that is growing rapidly. The current design calls for 28 computers, with expansion to 80 in the next six months. Because of the speed at which the network is expected to grow, you want to make sure that adding new devices in the network and troubleshooting will be as easy as possible. So, considering these factors, which topology you will prefer for this type of network? Give proper reasoning to support your answer. (5 Marks)

Q.2 How does the logical topology differ from the physical topology? Can a single physical topology support multiple logical topologies? Answer with proper reasons. (5 Marks)


Q 3 Suppose you have been asked to put together a proposal for a new computer network of a company. You have been asked to specifically list the advantages to networking. Of the following equipment the company owns, which devices can be shared on a network? (5 Marks)

Choose all that apply:

1.    Keyboard
2.    Mouse
3.    Scanner
4.    Monitor
5.    CD-ROM drives
6.    Light pen
7.    Printer



Note:

  • Assignment should be in your own wordings not exactly copied from Internet, handouts or books.

  • Your answer should be “to the point”.