Wednesday, January 29, 2014

Selection Sort Code in C++



Selection Sort Method Which sort an array using selection sort.......... 

void SelectionSrt(int A[10])
       {     
              int i,j;
              int temp;
              for(i=0; i<10; i++)
              {
                     for(j=i; j<10; j++)
                     {
                           if(A[i]>A[j])
                           {
                                  temp=A[i];
                                  A[i]=A[j];
                                  A[j]=temp;
                           }
                     }
              }

Wednesday, January 22, 2014

Bubble Sort Code in C++



Bubble Sort Method Which sort an array using bubble sort..........

void BubbleSrt(int A[10])
       {     
              int i,j;
              int temp;
              for(i=0; i<10; i++)
              {
                     for(j=i+1; j<10; j++)
                     {
                           if(A[i]>A[j])
                           {
                                  temp=A[i];
                                  A[i]=A[j];
                                  A[j]=temp;
                           }
                     }
              }
              cout<<"Sorted values after bubble sort"<<endl;
              for(i=0; i<10;i++)
              {
                     cout<<A[i]<<"";
              }
       }

Saturday, January 18, 2014

How to Make a USB Bootable

1. (Open Command Prompt as an Administrator) from start manue or by writing cmd in Run window.

2. (Open the disk management utility) by typing diskpart command in command prompt and then press enter.


3. (Display the connected disk to the pc) by typing list disk command in command prompt and then press enter your's USB is also listed here.


4. (Select the USB drive) by typing the select disk # , command in command prompt and then press enter (replace the # with the disk number of USB in previous step).


5. (Clean the flesh drive) by typing the clean command and then press enter.


6. (Create a bootable partition) by typing create partition primary command and then press enter.


7. (Select the new partition) by typing select partition 1 command and then press enter after receiving confirmation message, type active command and then press enter this will activate the partition. 


8. (Format USB Drive) by typing format fs=fat32 command and then press enter (this format peocess may be slow that take an hour) .


9. (Assign the USB a drive letter) by typing assign command and then press enter to give a letter designation. then type exit to end disk management utility.


10. (Copy the operating system) now copy the files of the operating system into the bootable USB drive you may also copy the drivers into the USB drive for your's easyness.


Thaks for visiting us Plz write your's comments bellow.........:)

Friday, January 17, 2014

Scientific Calculator Code



Form1 Coding
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Cartoon
{
    public partial class Form1 : Form
    {
        double a, b, Ang;
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            a = Convert.ToDouble(textBox1.Text);
            b = Convert.ToDouble(textBox2.Text);
            Class1 C1 = new Class1();
            textBox3.Text = Convert.ToString(C1.Add(a,b));
        }

        private void button2_Click(object sender, EventArgs e)
        {
            a = Convert.ToDouble(textBox1.Text);
            b = Convert.ToDouble(textBox2.Text);
            Class1 C1 = new Class1();
            textBox3.Text = Convert.ToString(C1.Subtract(a,b));
        }

        private void button3_Click(object sender, EventArgs e)
        {
            a = Convert.ToDouble(textBox1.Text);
            b = Convert.ToDouble(textBox2.Text);
            Class1 C1 = new Class1();
            textBox3.Text = Convert.ToString(C1.Multiply(a,b));
        }

        private void button4_Click(object sender, EventArgs e)
        {
            a = Convert.ToDouble(textBox1.Text);
            b = Convert.ToDouble(textBox2.Text);
            Class1 C1 = new Class1();
            textBox3.Text = Convert.ToString(C1.Divide(a, b));
        }

        private void button5_Click(object sender, EventArgs e)
        {
            Ang = Convert.ToDouble(textBox4.Text);
            Class1 C1 = new Class1();
            textBox5.Text = Convert.ToString(C1.Sin(Ang));
        }

        private void button6_Click(object sender, EventArgs e)
        {
            Ang = Convert.ToDouble(textBox4.Text);
            Class1 C2 = new Class1();
            textBox5.Text = Convert.ToString(C2.Cos(Ang));
        }

        private void button7_Click(object sender, EventArgs e)
        {
            Ang = Convert.ToDouble(textBox4.Text);
            Class1 C3 = new Class1();
            textBox5.Text = Convert.ToString(C3.Tan(Ang));
        }

        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {
            label2.Visible = true;
            label3.Visible = true;
            label4.Visible = true;
            label5.Visible = false;
            label6.Visible = false;
            textBox1.Visible = true;
            textBox2.Visible = true;
            textBox3.Visible = true;
            button1.Visible = true;
            button2.Visible = true;
            button3.Visible = true;
            button4.Visible = true;
            textBox4.Visible = false;           
            textBox5.Visible = false;
            button5.Visible= false;
            button6.Visible = false;
            button7.Visible = false;
        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            label5.Visible = true;
            label6.Visible = true;
            label2.Visible = false;
            label3.Visible = false;
            label4.Visible = false;
            textBox4.Visible = true;
            textBox5.Visible = true;
            button5.Visible = true;
            button6.Visible = true;
            button7.Visible = true;
            textBox1.Visible = false;
            textBox2.Visible = false;
            textBox3.Visible = false;
            button1.Visible = false;
            button2.Visible = false;
            button3.Visible = false;
            button4.Visible = false;
        }
    }
}

Method class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Cartoon
{
    class Class1
    {
        double Answer,Ang_Value;
        public double Add(double x, double y)
        {
            Answer = x + y;
            return Answer;      
        }
        public double Subtract(double x, double y)
        {
            Answer = x - y;
            return Answer;
        }
        public double Multiply(double x, double y)
        {
            Answer = x * y;
            return Answer;
        }
        public double Divide(double x, double y)
        {
            Answer = x / y;
            return Answer;
        }
        public double Sin(double a)
        {
            if (a == 0)
            {
                Ang_Value = 0;
            }
            else
                if (a == 30)
                {
                    Ang_Value = 0.5;
                }
                else
                    if (a == 45)
                    {
                        Ang_Value = 0.7071;
                    }
                    else
                        if (a == 60)
                        {
                            Ang_Value = 0.8660;
                        }
                        else
                            if (a == 90)
                            {
                                Ang_Value = 1;
                            }
            return Ang_Value;

        }

        public double Cos(double a)
        {
            if (a == 0)
            {
                Ang_Value = 1;
            }
            else
                if (a == 30)
                {
                    Ang_Value = 0.8660;
                }
                else
                    if (a == 45)
                    {
                        Ang_Value = 0.7071;
                    }
                    else
                        if (a == 60)
                        {
                            Ang_Value = 0.5;
                        }
                        else
                            if (a == 90)
                            {
                                Ang_Value = 0;
                            }
            return Ang_Value;       
        }
        public double Tan(double a)
        {
            if (a == 0)
            {
                Ang_Value = 0;
            }
            else
                if (a == 30)
                {
                    Ang_Value = 0.5773;
                }
                else
                    if (a == 45)
                    {
                        Ang_Value = 1;
                    }
                    else
                        if (a == 60)
                        {
                            Ang_Value = 1.7320;
                        }
            return Ang_Value;
        }
    }
}