Tuesday, March 26, 2013

Programming: What's new in Programming Techology?

Whats new in Programming Technology?
World changes in seconds, even worst Computer world changes in picoseconds.Battle over programming languages continues and new technologies are evolving seconds by seconds.
Well programming life is not easy. It gets worst when you have to switch between one programming languages to other programming language. I know if we know the syntax of one one programming languages then its not that hard to learn other one.Today I am going to share some new programming experience with Windows 8 machines.
Windows world has changed. Now individual can write program in any programming language, make amazing apps (application) for multiple platforms.
We are no more limited to any programming language. We can use whatever programming language we like. Can you imagine building apps with wed development languages like HTML5, CSS and JavaScript? Well its real.
Now we can use HTML5, CSS and JavaScript to build awesome commercial application without knowing other hardcore programming like Java, C++ or C#.

Windows8 app store lets user do upload web based application as well which are perfectly written in web technologies. With the less knowledge of Java and C++, one can create great application with just basic knowledge of HTML5.
If you hate Windows and like other Open source platforms like Linux/ BSD or other programming then you should be happy enough that you can use the same skills to write apps for Ubuntu phones and desktops.
We know that New Ubuntu phones are coming and lots of application are being released. Its perfect time for programmers to switch their PC to Linux and download QT creator and start making cool apps.
Unlike Windows8 and Ubuntu apps can work for both Ubuntu phones and desktop computers. Which is great. Got to download the right tools and program great apps and help this world be a great place for programmer and general users.




Monday, March 25, 2013

C# 2012: Print your name five times

Do you love programming in command line, Program written in Visual studio using c# can be debugged in command line without GUI. Here is simple program written in C# which prints your name five times: 


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Class_Activity_Friday_5_DC
{
class Program {
static void Main(string[] args)
{
for (int z = 1; z <= 5; z++)
{
Console.WriteLine("John Doe"); //Write your name
     }

   }
  } 
 }

The program is written using for loop. If you have some experience in programming then you will definitely understand it. Do not forget to comment me if you have any questions.

C# 2012: Quadratic Equation

If you are taking college algebra and you think its too difficult to do calculation. One more condition, if you are good in programming like me then go ahead and paste this code in your visual studio and do the college assignment in few minutes.
 I wrote this crapy codes in my c# class, back 2012. I passed maths class with A, because I developed right tool at right time. I have not pasted the .designer.cs file codes. If you have some experience in programming then you will be able to figure out yourself. Any questions, then feel free to comment down. Chill the code !!
 
--> 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 dQuadratic_Equation
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnSolve_Click(object sender, EventArgs e)
        {
            double A = Convert.ToDouble(coeffXx.Text);
            double B = Convert.ToDouble(coeffX.Text);

            double C = Convert.ToDouble(consTant.Text);
           

            double E = -B - Math.Sqrt((Math.Pow(B,2) - 4*A*C));
            double F = -B + Math.Sqrt((Math.Pow(B,2) - 4*A*C));
          
         
            double G = 2 * A;

            double Xp =(E)/(G);
            double Xn = (F)/(G);

            positiveX.Text = Xp.ToString();
            negativeX.Text = Xn.ToString();


        }

        private void btnEraser_Click(object sender, EventArgs e)
        {
          
            coeffX.Clear();
            coeffXx.Clear();
            consTant.Clear();
            coeffXx.Focus();

        }

        private void btnOff_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}

-->

Sunday, March 24, 2013

Follow me on twitter!

Windows 8 App: using javascript and HTML5

 Building First Windows 8 application which i can write Hello World. This is default.js file codes which are all javascript code. If you want to learn more about windows 8 Application development then I recommend you to visit http://www.msdn.microsoft.com




// For an introduction to the Blank template, see the following documentation:
// http://go.microsoft.com/fwlink/p/?linkid=232509
(function () {
    "use strict";

    WinJS.Binding.optimizeBindingReferences = true;

    var app = WinJS.Application;
    var activation = Windows.ApplicationModel.Activation;

    app.onactivated = function (args) {
        if (args.detail.kind === activation.ActivationKind.launch) {
            if (args.detail.previousExecutionState !== activation.ApplicationExecutionState.terminated) {
                // TODO: This application has been newly launched. Initialize
                // your application here.
            } else {
                // TODO: This application has been reactivated from suspension.
                // Restore application state here.

                // Retrieve our greetingOutput session state info,
                // if it exists.
                var outputValue = WinJS.Application.sessionState.greetingOutput;
                if (outputValue) {
                    var greetingOutput = document.getElementById("greetingOutput");
                    greetingOutput.innerText = outputValue;
                }
            }
            args.setPromise(WinJS.UI.processAll().then(function completed() {

                // Retrieve the div that hosts the Rating control.
                var ratingControlDiv = document.getElementById("ratingControlDiv");

                // Retrieve the actual Rating control.
                var ratingControl = ratingControlDiv.winControl;

                // Register the event handler.
                ratingControl.addEventListener("change", ratingChanged, false);

                // Retrieve the button and register our event handler.
                var helloButton = document.getElementById("helloButton");
                helloButton.addEventListener("click", buttonClickHandler, false);

                // Retrieve the input element and register our
                // event handler.
                var nameInput = document.getElementById("nameInput");
                nameInput.addEventListener("change", nameInputChanged);

                // Restore app data.
                var roamingSettings = Windows.Storage.ApplicationData.current.roamingSettings;

                // Restore the user name.
                var userName =
                    Windows.Storage.ApplicationData.current.roamingSettings.values["userName"];
                if (userName) {
                    nameInput.value = userName;
                }

                // Restore the rating.
                var greetingRating = roamingSettings.values["greetingRating"];
                if (greetingRating) {
                    ratingControl.userRating = greetingRating;
                    var ratingOutput = document.getElementById("ratingOutput");
                    ratingOutput.innerText = greetingRating;
                }

            }));

        }
    };

    app.oncheckpoint = function (args) {
        // TODO: This application is about to be suspended. Save any state
        // that needs to persist across suspensions here. You might use the
        // WinJS.Application.sessionState object, which is automatically
        // saved and restored across suspension. If you need to complete an
        // asynchronous operation before your application is suspended, call
        // args.setPromise().
    };

    function buttonClickHandler(eventInfo) {

        var userName = document.getElementById("nameInput").value;
        var greetingString = "Hello, " + userName + "!";
        document.getElementById("greetingOutput").innerText = greetingString;

        // Save the session data.
        WinJS.Application.sessionState.greetingOutput = greetingString;
    }

    function ratingChanged(eventInfo) {

        var ratingOutput = document.getElementById("ratingOutput");
        ratingOutput.innerText = eventInfo.detail.tentativeRating;

        // Store the rating for multiple sessions.
        var appData = Windows.Storage.ApplicationData.current;
        var roamingSettings = appData.roamingSettings;
        roamingSettings.values["greetingRating"] = eventInfo.detail.tentativeRating;
    }

    function nameInputChanged(eventInfo) {
        var nameInput = eventInfo.srcElement;

        // Store the user's name for multiple sessions.
        var appData = Windows.Storage.ApplicationData.current;
        var roamingSettings = appData.roamingSettings;
        roamingSettings.values["userName"] = nameInput.value;
    }

    app.start();
})();

Friday, March 22, 2013

C# 2012: Pseudocode

Pseudo-code, literally it means fake or false  code. Knowing to write pseudo-code is very important fact in the life of programming. It helps you to figure out the flaws about your program and enhance your idea as well.

Here is a sample of pseudo code which helps in calculating the quadratic equation in simple way:
We know famous equation (ax2 + bX+ c = 0)
First of all we have to ask user Enter the value for coefficient of X(square):
and enter the value for coefficient of X and finally value for constant. Then we store the value in some variable and execute the formula:


//Global Variables
decimal a=0;
decimal b = 0;
decimal c= 0;

{
a = Convert.Todecimal(textbox1.text);
b = Convert.Todecimal(textbox2.text);
c= Convert.ToDeciaml(textbox3.text);

}

//write the forumla
decimal result = (formula goes here//);
textbox4.text = result.ToString();
}

This is just an example of pseudo code which works in theory but never executes in practical. Note: in the formula, you need to use Math method and operators to execute further. I can help you to understand the logical flow of the program.

You can comment me if you want to get further free codes in C#. Thank you!

Thursday, March 21, 2013

Python : Simple Program

Python is one of the most important procedural programming language. I learnt this in my second semester. This is one of the simple program I would like to share:

#Deenesh chowdhary
#2013
#deenesh@okstate.edu
#Conditional statement in entering bar


print ("Welocome to Okmulgee Dance Bar! ")
y = input ("What is your name ?"))
number = 18)
gate= int(input ("Enter your age: ")))
if gate== number:)
print ("You are right aged," + y, "Welcome and have fun"))
elif gate< number:)
print("Grow up," + y ,"Still wait some more years to come back! "))
elif gate> number:)
print("Welcome! "+ y ,"What would you like to have?"))
)
if gate >= number:)
z = input ( "Enter your order: "))
print("Thank you for ordering,"+ z, "! Your order will be proceed in few seconds!"))
elif gate < number:)
print("Thank you for your try! Hope you will turn 18 soon!"))
input ("press"))

Javascript: Algebra Calculator

function emc(){ a = Number(document.calculator.number1.value); b = Number(document.calculator.number2.value); c = a*a +2*a*b +b*b; document.calculator.total.value = c; JavaScript: Algebra Calculator, If you are having any kind of Problem in Algebra; then here a simple calculator which can calculate the value of  (a + b)2 = (a2 + 2ab + b2)



function emc(){    
a = Number(document.calculator.number1.value);
b = Number(document.calculator.number2.value);
c = a*a +2*a*b +b*b;    
document.calculator.total.value = c;   
}

form name="calculator"
Enter value of a input name="number1" type="text"
Enter value of b : input name="number2" type="text"
input name="total" type="text"
input onclick="javascript:emc();" type="button" value="Calculate"

Wednesday, March 20, 2013

C# 2012: Gravitation Force Codes

Its time for you to try new challenges in C# programming language. C# is one of the most powerful object oriented language. Its is easy to learn and can be programmed very efficient programs very easily.
Here are the screenshots:
-->
Initial Program

Result after entering data

Here are the free code: I have written the code myself. So it will be hard for you to understand but you can email or contact me to ask any questions:

Use this code to put in any .cs file:
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 Gravitational_Force
{
    public partial class Form1 : Form
    {
        //Global Variable
        decimal M1;
        decimal M2;
        decimal r;
        decimal Force;


        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            M1 = Convert.ToDecimal(txtM1.Text);
            M2 = Convert.ToDecimal(txtM2.Text);
            r = Convert.ToDecimal(txtR.Text);

            double G = 6.6726 * Math.Pow(10, -11);
            decimal Gc = (decimal)G; //Converting double to decimla
            Force = (Gc* M1 * M2)/ r * r;

            label10.Text = "Force = " +Math.Round( Force,10) + "N";

            label5.Text = "F = G * M1 * M2 * / r* r ";
            label6.Text = " F = 6.6726* 10 ^-11 * " + M1 + "*" + M2;
            label8.Text =  r + " * " + r;
            label9.Text = "------------------";
            label7.Text = " F =  " +Math.Round(Force, 10) + " N";

        }
    }
}

---Now its time for designers:
Place these codes in you designer.cs file:

namespace Gravitational_Force
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
            this.txtM1 = new System.Windows.Forms.TextBox();
            this.txtM2 = new System.Windows.Forms.TextBox();
            this.txtR = new System.Windows.Forms.TextBox();
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.button1 = new System.Windows.Forms.Button();
            this.label4 = new System.Windows.Forms.Label();
            this.label5 = new System.Windows.Forms.Label();
            this.label6 = new System.Windows.Forms.Label();
            this.label7 = new System.Windows.Forms.Label();
            this.label8 = new System.Windows.Forms.Label();
            this.label9 = new System.Windows.Forms.Label();
            this.pictureBox1 = new System.Windows.Forms.PictureBox();
            this.label10 = new System.Windows.Forms.Label();
            this.groupBox1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
            this.SuspendLayout();
            //
            // txtM1
            //
            this.txtM1.Location = new System.Drawing.Point(214, 31);
            this.txtM1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.txtM1.Name = "txtM1";
            this.txtM1.Size = new System.Drawing.Size(214, 24);
            this.txtM1.TabIndex = 0;
            //
            // txtM2
            //
            this.txtM2.Location = new System.Drawing.Point(214, 80);
            this.txtM2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.txtM2.Name = "txtM2";
            this.txtM2.Size = new System.Drawing.Size(214, 24);
            this.txtM2.TabIndex = 1;
            //
            // txtR
            //
            this.txtR.Location = new System.Drawing.Point(214, 129);
            this.txtR.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.txtR.Name = "txtR";
            this.txtR.Size = new System.Drawing.Size(214, 24);
            this.txtR.TabIndex = 2;
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(31, 31);
            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(151, 18);
            this.label1.TabIndex = 3;
            this.label1.Text = "1st Object Mass (M1)";
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(31, 80);
            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(155, 18);
            this.label2.TabIndex = 4;
            this.label2.Text = "2nd Object Mass (M2)";
            //
            // label3
            //
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(107, 132);
            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(73, 18);
            this.label3.TabIndex = 5;
            this.label3.Text = "Radius (r)";
            //
            // groupBox1
            //
            this.groupBox1.BackColor = System.Drawing.SystemColors.ActiveCaption;
            this.groupBox1.Controls.Add(this.label10);
            this.groupBox1.Controls.Add(this.label9);
            this.groupBox1.Controls.Add(this.label8);
            this.groupBox1.Controls.Add(this.label7);
            this.groupBox1.Controls.Add(this.label6);
            this.groupBox1.Controls.Add(this.label5);
            this.groupBox1.Controls.Add(this.label4);
            this.groupBox1.Location = new System.Drawing.Point(3, 205);
            this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.groupBox1.Size = new System.Drawing.Size(425, 286);
            this.groupBox1.TabIndex = 6;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Result";
            //
            // button1
            //
            this.button1.Location = new System.Drawing.Point(256, 161);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(113, 37);
            this.button1.TabIndex = 7;
            this.button1.Text = "Calculate";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // label4
            //
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(45, 35);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(0, 18);
            this.label4.TabIndex = 0;
            //
            // label5
            //
            this.label5.AutoSize = true;
            this.label5.Location = new System.Drawing.Point(45, 93);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(12, 18);
            this.label5.TabIndex = 1;
            this.label5.Text = ".";
            //
            // label6
            //
            this.label6.AutoSize = true;
            this.label6.Location = new System.Drawing.Point(45, 139);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(12, 18);
            this.label6.TabIndex = 2;
            this.label6.Text = ".";
            //
            // label7
            //
            this.label7.AutoSize = true;
            this.label7.Location = new System.Drawing.Point(45, 223);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(12, 18);
            this.label7.TabIndex = 3;
            this.label7.Text = ".";
            //
            // label8
            //
            this.label8.AutoSize = true;
            this.label8.Location = new System.Drawing.Point(104, 175);
            this.label8.Name = "label8";
            this.label8.Size = new System.Drawing.Size(12, 18);
            this.label8.TabIndex = 4;
            this.label8.Text = ".";
            //
            // label9
            //
            this.label9.AutoSize = true;
            this.label9.Location = new System.Drawing.Point(97, 157);
            this.label9.Name = "label9";
            this.label9.Size = new System.Drawing.Size(12, 18);
            this.label9.TabIndex = 5;
            this.label9.Text = ".";
            //
            // pictureBox1
            //
            this.pictureBox1.ErrorImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.ErrorImage")));
            this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
            this.pictureBox1.Location = new System.Drawing.Point(446, 22);
            this.pictureBox1.Name = "pictureBox1";
            this.pictureBox1.Size = new System.Drawing.Size(415, 469);
            this.pictureBox1.TabIndex = 8;
            this.pictureBox1.TabStop = false;
            //
            // label10
            //
            this.label10.AutoSize = true;
            this.label10.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label10.ForeColor = System.Drawing.Color.Red;
            this.label10.Location = new System.Drawing.Point(24, 35);
            this.label10.Name = "label10";
            this.label10.Size = new System.Drawing.Size(15, 24);
            this.label10.TabIndex = 6;
            this.label10.Text = ".";
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(855, 496);
            this.Controls.Add(this.groupBox1);
            this.Controls.Add(this.pictureBox1);
            this.Controls.Add(this.button1);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.txtR);
            this.Controls.Add(this.txtM2);
            this.Controls.Add(this.txtM1);
            this.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
            this.Name = "Form1";
            this.Text = "Gravity Equation";
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.TextBox txtM1;
        private System.Windows.Forms.TextBox txtM2;
        private System.Windows.Forms.TextBox txtR;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.Label label7;
        private System.Windows.Forms.Label label6;
        private System.Windows.Forms.Label label8;
        private System.Windows.Forms.Label label9;
        private System.Windows.Forms.PictureBox pictureBox1;
        private System.Windows.Forms.Label label10;
    }
}


ENJOY the code Thank You!

C# 2012 : Body Mass Index

  Free Body Mass Index Calculator:

use the code for form1.cs:

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 Advance_Body_Mass_Calculator_Deenesh
{
    public partial class Form1 : Form
    {
        //Global variables

        decimal Weight;
        decimal Height;
        decimal BodyMassIndex;


        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (IsValidData())
            {
                Weight = Convert.ToDecimal(txtWeight.Text);
                Height = Convert.ToDecimal(txtHeight.Text);

                BodyMassIndex = (Weight * 703) / (Height * Height);

                txtMassIndex.Text = Convert.ToString(Math.Round(BodyMassIndex, 4) + " lbs/ Inch Square");
            }
        }
        public bool IsValidData()
        {
            return
                IsPresent(txtWeight, "Weight")
                && IsPresent(txtHeight, "Height")
                && IsDecimal(txtWeight, "Weight")
                && IsDecimal(txtHeight, "Height")
                && IsWithinRange(txtWeight, "Weight", 1 , 100000)
                && IsWithinRange(txtHeight, "Height", 1 , 100);

        }
        public bool IsPresent(TextBox dc, string name)
        {
            if (dc.Text == "")
            {
                MessageBox.Show(name + " should not be empty.", "Entry Error");
                dc.Focus();
                return false;
            }
            return true;
        }

        public bool IsDecimal(TextBox dc, string name)

        {
            try
            {
                Convert.ToDecimal(dc.Text);
                return true;
            }
            catch (FormatException)
            {
                MessageBox.Show(name + "  must be a decimal value. " + " eg. 1234", "Invalid Data Error");
                dc.Focus();
                return false;
            }
        }
        public bool IsWithinRange(TextBox dc, string name, decimal min, decimal max)
        {
            decimal digit = Convert.ToDecimal(dc.Text);
            if (digit < min || digit > max)
            {
                MessageBox.Show(name + " must be between " + min + " and " + max + "!", "Range Error");
                dc.Focus();
                return false;
            }
            return true;
       
        }
        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void digitChange(object sender, EventArgs e)
        {
            txtMassIndex.Clear();
        }
    }
}

--Use the code for form1.designer.cs

namespace Advance_Body_Mass_Calculator_Deenesh
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.btnCalculate = new System.Windows.Forms.Button();
            this.btnClose = new System.Windows.Forms.Button();
            this.txtWeight = new System.Windows.Forms.TextBox();
            this.txtHeight = new System.Windows.Forms.TextBox();
            this.txtMassIndex = new System.Windows.Forms.TextBox();
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.SuspendLayout();
            //
            // btnCalculate
            //
            this.btnCalculate.Location = new System.Drawing.Point(23, 262);
            this.btnCalculate.Margin = new System.Windows.Forms.Padding(4);
            this.btnCalculate.Name = "btnCalculate";
            this.btnCalculate.Size = new System.Drawing.Size(112, 32);
            this.btnCalculate.TabIndex = 2;
            this.btnCalculate.Text = "Calculate";
            this.btnCalculate.UseVisualStyleBackColor = true;
            this.btnCalculate.Click += new System.EventHandler(this.button1_Click);
            //
            // btnClose
            //
            this.btnClose.Location = new System.Drawing.Point(246, 262);
            this.btnClose.Margin = new System.Windows.Forms.Padding(4);
            this.btnClose.Name = "btnClose";
            this.btnClose.Size = new System.Drawing.Size(81, 32);
            this.btnClose.TabIndex = 3;
            this.btnClose.Text = "Close";
            this.btnClose.UseVisualStyleBackColor = true;
            this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
            //
            // txtWeight
            //
            this.txtWeight.Location = new System.Drawing.Point(150, 18);
            this.txtWeight.Margin = new System.Windows.Forms.Padding(4);
            this.txtWeight.Name = "txtWeight";
            this.txtWeight.Size = new System.Drawing.Size(177, 24);
            this.txtWeight.TabIndex = 0;
            this.txtWeight.TextChanged += new System.EventHandler(this.digitChange);
            //
            // txtHeight
            //
            this.txtHeight.Location = new System.Drawing.Point(150, 84);
            this.txtHeight.Margin = new System.Windows.Forms.Padding(4);
            this.txtHeight.Name = "txtHeight";
            this.txtHeight.Size = new System.Drawing.Size(177, 24);
            this.txtHeight.TabIndex = 1;
            this.txtHeight.TextChanged += new System.EventHandler(this.digitChange);
            //
            // txtMassIndex
            //
            this.txtMassIndex.Location = new System.Drawing.Point(153, 187);
            this.txtMassIndex.Margin = new System.Windows.Forms.Padding(4);
            this.txtMassIndex.Name = "txtMassIndex";
            this.txtMassIndex.ReadOnly = true;
            this.txtMassIndex.Size = new System.Drawing.Size(187, 24);
            this.txtMassIndex.TabIndex = 4;
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(20, 18);
            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(91, 18);
            this.label1.TabIndex = 5;
            this.label1.Text = "Weight (lbs):";
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(20, 87);
            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(95, 18);
            this.label2.TabIndex = 6;
            this.label2.Text = "Height (inch):";
            //
            // label3
            //
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(10, 190);
            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(125, 18);
            this.label3.TabIndex = 7;
            this.label3.Text = "Body Mass Index:";
            //
            // Form1
            //
            this.AcceptButton = this.btnCalculate;
            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(353, 314);
            this.Controls.Add(this.label3);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.txtMassIndex);
            this.Controls.Add(this.txtHeight);
            this.Controls.Add(this.txtWeight);
            this.Controls.Add(this.btnClose);
            this.Controls.Add(this.btnCalculate);
            this.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.Margin = new System.Windows.Forms.Padding(4);
            this.Name = "Form1";
            this.Text = "Advance Body Mass Calculator";
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Button btnCalculate;
        private System.Windows.Forms.Button btnClose;
        private System.Windows.Forms.TextBox txtWeight;
        private System.Windows.Forms.TextBox txtHeight;
        private System.Windows.Forms.TextBox txtMassIndex;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label label3;
    }
}


Thank you!

C#2012 :Lunch Order Billing Menu

Lunch Order Calculator in C# 2012:




Use this file in .cs file
//
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 OSU_Lunch_Order
{
    public partial class frmHamburger : Form
    {
        //Global Decleration
        decimal Subtotal;
        decimal Tax = 0.0775m;
        decimal OrderTotal;
       

        public frmHamburger()
        {
            InitializeComponent();
        }
       

        //Events for Check-Changed
        private void Addons_CheckedChanged(object sender, EventArgs e)
        {
            if (rdoHamburger.Checked)
            {
                //Displays label in the checkbox - Text Change
                grpAddon.Text = "Add-on items($.75/each";
                chk1.Text = "Lettuce, tomato, and onions";
                chk2.Text = "Mayonnaise and mustard";
                chk3.Text = "French fries";

                // Remove the Checkbox
                chk1.Checked = false;
                chk2.Checked = false;
                chk3.Checked = false;

                //Clears the Subtotal, Tax and Order Total
                txtOrderTotal.Clear();
                txtSubtotal.Clear();
                txtTax.Clear();

            }
            else if (rdoPizza.Checked)
            {
                //Labels for Checkbox
                grpAddon.Text = "Add-on items($.50/each)";
                chk1.Text = "Pepproni";
                chk2.Text = "Sausage";
                chk3.Text = "Olives";

                // Removes the Checkbox
                chk1.Checked = false;
                chk2.Checked = false;
                chk3.Checked = false;

                //Clears the Subtotal, Tax and Order Total
                txtOrderTotal.Clear();
                txtSubtotal.Clear();
                txtTax.Clear();
            }
            else if (rdoSalad.Checked)
            {
                //Labels for Checkbox
                grpAddon.Text = "Add-on items($.25/each";
                chk1.Text = "Croutons";
                chk2.Text = "Bacon bits";
                chk3.Text = "Bread sticks";

                //Removes the checkbox
                chk1.Checked = false;
                chk2.Checked = false;
                chk3.Checked = false;

                //Clears the Subtotal, Tax and Order Total
                txtOrderTotal.Clear();
                txtSubtotal.Clear();
                txtTax.Clear();
            }
            txtOrderTotal.Clear();
            txtSubtotal.Clear();
            txtTax.Clear();
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
          

            string message = "Thank You for Using Our Service!\n Would You Like use our service again?";
            DialogResult button =
                MessageBox.Show(message, "Dear Customer",
                MessageBoxButtons.YesNo,
                MessageBoxIcon.Information);

            if (button == DialogResult.No)
            {
                this.Close();
            }
            if (button == DialogResult.Yes)
            {
                MessageBox.Show("Thank You!! \n We Hope you will come Soon!", "Greeting Message");
                this.Close();
            }
        }
        // Codes for Buttons
        private void btnOrder_Click(object sender, EventArgs e)
        {
            decimal add = 0m;
            if (chk1.Checked)
            {
                add++;
            }
            if (chk2.Checked)
            {
                add++;
            }
            if (chk3.Checked)
            {
                add++;
            }
            if (rdoHamburger.Checked)
            {
                decimal Hamburger = Convert.ToDecimal(rdoHamburger.Checked);
                Hamburger = 6.95m;

                Subtotal = Hamburger + (add *.75m);
                Tax = Subtotal * 0.0775m;
                OrderTotal = Tax + Subtotal;

                txtSubtotal.Text = Subtotal.ToString("c");
                txtTax.Text = Tax.ToString("c");
                txtOrderTotal.Text = OrderTotal.ToString("c");

            }
            else if (rdoPizza.Checked)
            {

                decimal Pizza = Convert.ToDecimal(rdoPizza.Checked);
                Pizza = 5.95m;

                Subtotal = Pizza + (add * .50m);

                Tax = Subtotal * 0.00775m;

                OrderTotal = Tax + Subtotal;

                txtSubtotal.Text = Subtotal.ToString("c");
                txtTax.Text = Tax.ToString("c");
                txtOrderTotal.Text = OrderTotal.ToString("c");


            }
            else if (rdoSalad.Checked)
            {

                decimal salad = Convert.ToDecimal(rdoSalad.Checked);
                salad = 4.95m;

                Subtotal = salad + (add * .25m);

                Tax = Subtotal * 0.0775m;
                OrderTotal = Tax + Subtotal;
                txtSubtotal.Text = Subtotal.ToString("c");
                txtTax.Text = Tax.ToString("c");
                txtOrderTotal.Text = OrderTotal.ToString("c");
            }
        }

      

 
    }
 
}

--use this file in designer.cs file:

namespace OSU_Lunch_Order
{
    partial class frmHamburger
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.grpCourse = new System.Windows.Forms.GroupBox();
            this.rdoSalad = new System.Windows.Forms.RadioButton();
            this.rdoPizza = new System.Windows.Forms.RadioButton();
            this.rdoHamburger = new System.Windows.Forms.RadioButton();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.txtOrderTotal = new System.Windows.Forms.TextBox();
            this.txtTax = new System.Windows.Forms.TextBox();
            this.txtSubtotal = new System.Windows.Forms.TextBox();
            this.label3 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.btnOrder = new System.Windows.Forms.Button();
            this.btnExit = new System.Windows.Forms.Button();
            this.pageSetupDialog1 = new System.Windows.Forms.PageSetupDialog();
            this.grpAddon = new System.Windows.Forms.GroupBox();
            this.chk3 = new System.Windows.Forms.CheckBox();
            this.chk2 = new System.Windows.Forms.CheckBox();
            this.chk1 = new System.Windows.Forms.CheckBox();
            this.grpCourse.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.grpAddon.SuspendLayout();
            this.SuspendLayout();
            //
            // grpCourse
            //
            this.grpCourse.Controls.Add(this.rdoSalad);
            this.grpCourse.Controls.Add(this.rdoPizza);
            this.grpCourse.Controls.Add(this.rdoHamburger);
            this.grpCourse.Location = new System.Drawing.Point(13, 13);
            this.grpCourse.Name = "grpCourse";
            this.grpCourse.Size = new System.Drawing.Size(143, 98);
            this.grpCourse.TabIndex = 0;
            this.grpCourse.TabStop = false;
            this.grpCourse.Text = "Main Course";
            //
            // rdoSalad
            //
            this.rdoSalad.AutoSize = true;
            this.rdoSalad.Location = new System.Drawing.Point(20, 68);
            this.rdoSalad.Name = "rdoSalad";
            this.rdoSalad.Size = new System.Drawing.Size(88, 17);
            this.rdoSalad.TabIndex = 2;
            this.rdoSalad.Text = "Salad - $4.95";
            this.rdoSalad.UseVisualStyleBackColor = true;
            this.rdoSalad.CheckedChanged += new System.EventHandler(this.Addons_CheckedChanged);
            //
            // rdoPizza
            //
            this.rdoPizza.AutoSize = true;
            this.rdoPizza.Location = new System.Drawing.Point(20, 44);
            this.rdoPizza.Name = "rdoPizza";
            this.rdoPizza.Size = new System.Drawing.Size(86, 17);
            this.rdoPizza.TabIndex = 1;
            this.rdoPizza.Text = "Pizza - $5.95";
            this.rdoPizza.UseVisualStyleBackColor = true;
            this.rdoPizza.CheckedChanged += new System.EventHandler(this.Addons_CheckedChanged);
            //
            // rdoHamburger
            //
            this.rdoHamburger.AutoSize = true;
            this.rdoHamburger.Location = new System.Drawing.Point(20, 20);
            this.rdoHamburger.Name = "rdoHamburger";
            this.rdoHamburger.Size = new System.Drawing.Size(110, 17);
            this.rdoHamburger.TabIndex = 0;
            this.rdoHamburger.TabStop = true;
            this.rdoHamburger.Text = "Hamburger -$6.95";
            this.rdoHamburger.UseVisualStyleBackColor = true;
            this.rdoHamburger.CheckedChanged += new System.EventHandler(this.Addons_CheckedChanged);
            //
            // groupBox2
            //
            this.groupBox2.Controls.Add(this.txtOrderTotal);
            this.groupBox2.Controls.Add(this.txtTax);
            this.groupBox2.Controls.Add(this.txtSubtotal);
            this.groupBox2.Controls.Add(this.label3);
            this.groupBox2.Controls.Add(this.label2);
            this.groupBox2.Controls.Add(this.label1);
            this.groupBox2.Location = new System.Drawing.Point(13, 146);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(221, 113);
            this.groupBox2.TabIndex = 1;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "Order Total";
            //
            // txtOrderTotal
            //
            this.txtOrderTotal.Location = new System.Drawing.Point(100, 72);
            this.txtOrderTotal.Name = "txtOrderTotal";
            this.txtOrderTotal.ReadOnly = true;
            this.txtOrderTotal.Size = new System.Drawing.Size(100, 20);
            this.txtOrderTotal.TabIndex = 5;
            //
            // txtTax
            //
            this.txtTax.Location = new System.Drawing.Point(100, 50);
            this.txtTax.Name = "txtTax";
            this.txtTax.ReadOnly = true;
            this.txtTax.Size = new System.Drawing.Size(100, 20);
            this.txtTax.TabIndex = 4;
            //
            // txtSubtotal
            //
            this.txtSubtotal.Location = new System.Drawing.Point(100, 27);
            this.txtSubtotal.Name = "txtSubtotal";
            this.txtSubtotal.ReadOnly = true;
            this.txtSubtotal.Size = new System.Drawing.Size(100, 20);
            this.txtSubtotal.TabIndex = 3;
            //
            // label3
            //
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(17, 80);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(63, 13);
            this.label3.TabIndex = 2;
            this.label3.Text = "Order Total:";
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(20, 58);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(63, 13);
            this.label2.TabIndex = 1;
            this.label2.Text = "Tax(7.75%):";
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(20, 35);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(49, 13);
            this.label1.TabIndex = 0;
            this.label1.Text = "Subtotal:";
            //
            // btnOrder
            //
            this.btnOrder.Location = new System.Drawing.Point(259, 146);
            this.btnOrder.Name = "btnOrder";
            this.btnOrder.Size = new System.Drawing.Size(105, 28);
            this.btnOrder.TabIndex = 2;
            this.btnOrder.Text = "Place Order";
            this.btnOrder.UseVisualStyleBackColor = true;
            this.btnOrder.Click += new System.EventHandler(this.btnOrder_Click);
            //
            // btnExit
            //
            this.btnExit.Location = new System.Drawing.Point(259, 214);
            this.btnExit.Name = "btnExit";
            this.btnExit.Size = new System.Drawing.Size(105, 24);
            this.btnExit.TabIndex = 3;
            this.btnExit.Text = "Exit";
            this.btnExit.UseVisualStyleBackColor = true;
            this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
            //
            // grpAddon
            //
            this.grpAddon.Controls.Add(this.chk3);
            this.grpAddon.Controls.Add(this.chk2);
            this.grpAddon.Controls.Add(this.chk1);
            this.grpAddon.Location = new System.Drawing.Point(173, 13);
            this.grpAddon.Name = "grpAddon";
            this.grpAddon.Size = new System.Drawing.Size(200, 100);
            this.grpAddon.TabIndex = 4;
            this.grpAddon.TabStop = false;
            this.grpAddon.Text = "Add-on items";
            //
            // chk3
            //
            this.chk3.AutoSize = true;
            this.chk3.Location = new System.Drawing.Point(7, 68);
            this.chk3.Name = "chk3";
            this.chk3.Size = new System.Drawing.Size(15, 14);
            this.chk3.TabIndex = 2;
            this.chk3.UseVisualStyleBackColor = true;
            //
            // chk2
            //
            this.chk2.AutoSize = true;
            this.chk2.Location = new System.Drawing.Point(7, 44);
            this.chk2.Name = "chk2";
            this.chk2.Size = new System.Drawing.Size(15, 14);
            this.chk2.TabIndex = 1;
            this.chk2.UseVisualStyleBackColor = true;
            //
            // chk1
            //
            this.chk1.AutoSize = true;
            this.chk1.Location = new System.Drawing.Point(7, 20);
            this.chk1.Name = "chk1";
            this.chk1.Size = new System.Drawing.Size(15, 14);
            this.chk1.TabIndex = 0;
            this.chk1.UseVisualStyleBackColor = true;
            //
            // frmHamburger
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(376, 260);
            this.Controls.Add(this.grpAddon);
            this.Controls.Add(this.btnExit);
            this.Controls.Add(this.btnOrder);
            this.Controls.Add(this.groupBox2);
            this.Controls.Add(this.grpCourse);
            this.Name = "frmHamburger";
            this.Text = "  Lunch Order";
            this.grpCourse.ResumeLayout(false);
            this.grpCourse.PerformLayout();
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            this.grpAddon.ResumeLayout(false);
            this.grpAddon.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.GroupBox grpCourse;
        private System.Windows.Forms.RadioButton rdoSalad;
        private System.Windows.Forms.RadioButton rdoPizza;
        private System.Windows.Forms.RadioButton rdoHamburger;
        private System.Windows.Forms.GroupBox groupBox2;
        private System.Windows.Forms.TextBox txtOrderTotal;
        private System.Windows.Forms.TextBox txtTax;
        private System.Windows.Forms.TextBox txtSubtotal;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnOrder;
        private System.Windows.Forms.Button btnExit;
        private System.Windows.Forms.PageSetupDialog pageSetupDialog1;
        private System.Windows.Forms.GroupBox grpAddon;
        private System.Windows.Forms.CheckBox chk3;
        private System.Windows.Forms.CheckBox chk2;
        private System.Windows.Forms.CheckBox chk1;
    }
}


----Thank you! Enjoy the code!