Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 4

fac_id fac_name remarks

1 ARTS
2 NATURAL SCIENCE
3 SOCIAL SCIENCE
4 EDUCATION
5 ISLAMIC STUDIES
6 PHARMACY
7 COMMERCE AND BUSINESS
ADMINISTRATION

public int totalClicks()


02         {
03             int total=0;
04   
05             for(total = 0; total <= 100; total++)
06             {
07                 total++;
08                 MessageBox.Show("" + total);
09             }
10  
11           

BEGIN
FOR i := 0 TO n-2 DO
k := i; x := a[i];

FOR j := i+1 TO n-1 DO


IF a[j] < x THEN k := j; x := a[k] END
END ;
a[k] := a[i]; a[i] := x
END
END StraightSelection

Within class ExtendedArray...


public void quicksort(int first, int last) {
if (first < last) {
int mid = this.partition(first, last);
// sort the small values:
this.quicksort(first, mid-1);
// sort the large values:
this.quicksort(mid+1, last);
}
////////////////////////
// A Generic bubble sort.
#include <iostream>
using namespace std;
template <class X> void bubble(
X *items, // pointer to array to be sorted
int count) // number of items in array
{
register int a, b;
X t;
for(a=1; a<count; a++)
for(b=count-1; b>=a; b--)
if(items[b-1] > items[b]) {
// exchange elements
t = items[b-1];
items[b-1] = items[b];
items[b] = t;
}
}
int main()
{
int iarray[7] = {7, 5, 4, 3, 9, 8, 6};
double darray[5] = {4.3, 2.5, -0.9, 100.2, 3.0};
int i;
cout << "Here is unsorted integer array: ";
for(i=0; i<7; i++)

cout << iarray[i] << ' ';


cout << endl;
cout << "Here is unsorted double array: ";
for(i=0; i<5; i++)
cout << darray[i] << ' ';
cout << endl;
bubble(iarray, 7);
bubble(darray, 5);
cout << "Here is sorted integer array: ";
for(i=0; i<7; i++)
cout << iarray[i] << ' ';
cout << endl;
cout << "Here is sorted double array: ";
for(i=0; i<5; i++)
cout << darray[i] << ' ';
public partial class Form1 : Form
    {
    int click = 0;

    public Form1()
    {
        InitializeComponent();
    }

    private void panel1_Click(object sender, EventArgs e)


    {
            click++;      
    }

    private void panel1_Paint(object sender, PaintEventArgs e)


    {

    }

    private void btnReset_Click(object sender, EventArgs e)


    {
        timer1.Stop();
        txtClicks.Text = "";
        txtTime.Text = "";
        click = 0;

    }

    private void btnGo_Click(object sender, EventArgs e)


    {
        click = 0;
        timer1.Interval = int.Parse(txtTime.Text) * 1000;  
        timer1.Start();
    }

    private void timer1_Tick(object sender, EventArgs e)


    {
        timer1.Stop();
        MessageBox.Show(txtClicks.Text + " seconds up, No of clicks:" +
click.ToString());
    }
}
DDALine(320,1,320,480,12);

void DDALine( int x1, int y1,int x2,int y2);


{
int dx, dy, steps;
float x_inc, y_inc, x, y;

//
dx = x2 - x1;
dy = y2 - y1;

if (abs(dx) > abs(dy))


steps = abs(dx); //steps is larger of dx, dy
else
steps = abs(dy);

x_inc = dx/steps;
y_inc = dy/steps;

//either x_inc or y_inc = 1.0, the other is the slope

x=x1;
y=y1;
putxy(round(x), round(y));

for( i = 1 to steps) {
x = x + x_inc;
y = y + y_inc;
putxy(round(x), round(y));
}
}//End DDALine Algorithm Function

You might also like