Posts

Showing posts from June, 2013

How to make programmable thermometer by C# | Code

Image
How to make programmable thermometer by  C# | Code



For Fahrenheit to Centigrade we set the value of Fahrenheit from track bar and convert this value into Centigrade using this formula C= (F-32)*(5/9). privatevoid trackBar1_Scroll(object sender, EventArgs e)         {             maskedTextBox1.Text = (trackBar1.Value).ToString(); double change = (trackBar1.Value - 32) * (5.0 / 9.0);             change = Math.Round(change, 2);             maskedTextBox2.Text = change.ToString();         } For Centigrade to Fahrenheit we set the value of Centigrade from track bar and convert this value into Fahrenheit using this formula F= (C* (9/5)) +32. privatevoid trackBar2_Scroll_1(object sender, EventArgs e)         {             maskedTextBox3.Text = (trackBar2.Value).ToString();             maskedTextBox4.Text = ((trackBar2.Value * (9.0 / 5.0)) + 32).ToString();         }


How to calculate your GPA with simple application C#

Image
This is simplest GPA calculator in which user input the previous CGPA and previous Credit Hours (not for first semester these two fields) and no of new subjects and then enters the grade and credit hours of the subjects and insert in data grid view one by one if he by mistake put the wrong Grade or Credit Hours they can delete the wrong input by selecting the row and input again after input all Grades and Credit Hours then click on calculate button calculator calculate the new GPA and CGPA and display it.
Calculation code is:- //to calculate GPA float Gradepoint = 0; int k = 0; //for read data from datagridview for (int i = 0; i < l - 1; i++)             { //grade is A then CH * 4 if (dataGridView1.Rows[i].Cells[1].Value.ToString() == "A")  Gradepoint += 4 * float.Parse(dataGridView1.Rows[i].Cells[2].Value.ToString()); //grade is B+ then CH * 3.5 elseif (dataGridView1.Rows[i].Cells[1].Value.ToString() == "B+") Gradepoint += 7 * float.Parse(dataGridView1.Rows[i].Cells[2].Valu…

How to make Simple Tic Tac Toe Game in C# windows application

Image
How to make Simple Tic Tac Toe Game in C# windows application
This is simple Tic Tac Toe game in C# windows application in which we use 10 buttons, 9 buttons for game the text of these buttons by default null, and 1 for Reset.
The code of reset function is:
 publicvoid reset()                {                      button1.Text = button2.Text =                      button3.Text = button4.Text =                      button5.Text = button6.Text =                      button7.Text = button8.Text =                      button9.Text = "";                      i = 0;                 }
When we click on any button program first check the 2 conditions first the text of button is null and the how many times buttons are clicked.
  if (i < 9 && button1.Text == "")
Then check the value of (i) if the value of (i) is even then button text change into (X) else (O) and increase the value of (i).
  if (i % 2 == 0)                     button1.Text = "X"; else                     bu…

How to make notepad in 5 minutes

Image
How to make notepad in 5 minutes

Now today i will share with you Notepad (text editor ) .
Last time we sharedspeed test application . I design my notepad on C# . There are several different ideas but i was not sure what i wanted to do . Then i picked one of my design .
I thought it was the more effective one .

Innovative text editor is a sophisticated text editor for editing your data. It allows you to type your text and edit it using our wonderful color palette and tremendous range of font size with an extra feature of saving your files in .txt , .rtf or .doc format.Start typing your precious data using our editor and save it for further usage.

Code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TextEditor
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComp…

How to make Typing Speed Tester in C#

Image
How to make Typing Speed Tester in C#

Typing Speed Tester is an exciting game where you can test your typing skills.By using this you can find your words per minute speed and it will provide you filtered result of your correct, incorrect and untype words .It will provide you 100% accurate result free of any error.You can practice daily and can improve your speed.Share it with your friends and compare your results with them.Now Let’s start the journey and see how fast you can type?
Code

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TypingSpeed
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        string[] data;
        private void Form1_Load(object sender, EventArgs e)
        {
            textBox2.Text = "When the test first st…

How to make Simple Phone Book

Image
How to make Simple Phone Book



Code

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PhoneBook
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "" && textBox2.Text == "" && maskedTextBox1.Text.Length < 11)
                MessageBox.Show("Enter Data in all fields");
            else
            {
                dataGridView1.Rows.Add(textBox1.Text, textBox2.Text, maskedTextBox1.Text);
                textBox1.Text = "";
                textBox2.Text = "";
                maskedTextBox1.Text = "";
                textBox1.Focus();
            }
        }

   …

How to display many files in Backtrack

Image
How to display many files in Backtrack

Write a script, which displays one or more files on the monitor, each with its own title page, notify user which files were displayed on the monitor and which were not.
Code
#!/bin/bash echo " Current directry displayed below from the following list " ls echo "Press Enter to run the loop" read b files=`ls` i=19 for f in $files do echo "----------------------------------------------------------" echo "$i Title $f   ..." cat $f let i-=1 echo "
Loop Count is $i" echo "-----------------------------------------------------------" sleep 2 done
Screen Shot

How to display Good Morning in Backtrack

Image
How to display Good Morning in Backtrack

Write a script, which displays Good Morning if hour is less than 12, Good Afternoon if hour is less than5 p.m. and Good Evening if hour is greater than 5 p.m.
Code
#!/bin/bash clear hour=$(date +%H) echo”-----------------------------------------” echo”the yet time now” if [ "$hour" -lt 12 ]; then echo "Good Morning" elif [ "$hour" -lt 17 ]; then echo "Good Afternoon" elif [ "$hour" -gt 17 ]; then echo "Good Morning" fi
Screen Shot