Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Iam new to programming Can Any one help me to learn new skills .
I need solution and explanation for following problem . C#.NET using TextBox

1.Write a function that displays a message indicating the number of times it gets called: For
instance “The function has been called three times”. Write a program that calls this function
10 times from main(). You will need to use a global variable to store the count. A global
variable is declared outside the main() function. for following problems ..........

2 .A calculator for a supercomputer is to be designed using C language. While the engineers were
working on the project they found that the calculator was not giving correct answers for very
large calculations. For example, if 150000000 is to be multiplied by 10; the calculator gave faulty
result. The bug was detected to be the limited range of integers. Use type casting to design a
calculator that performs arithmetic operations of large inputs. (e.g; 150000000 *10) Take input
from the user in integer data type.

<From Comment>

Let me submit another type of Question which I have tried .
Write a program which takes two numbers as input from user and determines which is the larger
of the two numbers. The Program should also tell which of the entered numbers is even or odd.Please reviwe my version of this question , if possible try to correct it . I am having error .


C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Default3 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
    protected void Unnamed1_Click(object sender, EventArgs e)
    {
        if (Convert.ToInt16(TextBox1.Text) > Convert.ToInt16(TextBox2.Text))
            if (Convert.ToInt16(TextBox2.Text) > Convert.ToInt16(TextBox3.Text))
                if (Convert.ToInt16(TextBox1.Text) > Convert.ToInt16(TextBox3.Text))
                {
                    Label2.Text = "Number  1 is greatest  amoung  3  + Number 2 is the  AVERAGE  + Number  3 is the  smallest ";
                }
                else  if (Convert.ToInt16(TextBox1.Text) < Convert.ToInt16(TextBox2.Text))
                    if (Convert.ToInt16(TextBox2.Text) < Convert.ToInt16(TextBox3.Text))
                        if (Convert.ToInt16(TextBox1.Text) < Convert.ToInt16(TextBox3.Text))
                        {
                            Label3.Text = "Number  3 is greatest  amoung  3  + Number 2 is the  AVERAGE  + Number  1 is the  smallest ";                           
                        }
                     }
}


Thanks for your Interest. It will be really greatful if you help me with this learning process.
Posted
Updated 17-Oct-12 11:09am
v6
Comments
Sushil Mate 17-Oct-12 3:51am    
is it your homework?
sreeparthi 17-Oct-12 3:53am    
no , as I said I'm learning now , attempt to try this sample questions from online website .
Sushil Mate 17-Oct-12 3:56am    
great, so before to helping you.. what have you tried yet? Did you write any code to solve the problem?
sreeparthi 17-Oct-12 4:05am    
Ok , Let me submit another type of Question which I have tried .
Write a program which takes two numbers as input from user and determines which is the larger
of the two numbers. The Program should also tell which of the entered numbers is even or odd.Please reviwe my version of this question , if possible try to correct it . I am having error .


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Default3 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Unnamed1_Click(object sender, EventArgs e)
{
if (Convert.ToInt16(TextBox1.Text) > Convert.ToInt16(TextBox2.Text))

if (Convert.ToInt16(TextBox2.Text) > Convert.ToInt16(TextBox3.Text))

if (Convert.ToInt16(TextBox1.Text) > Convert.ToInt16(TextBox3.Text))
{

Label2.Text = "Number 1 is greatest amoung 3 + Number 2 is the AVERAGE + Number 3 is the smallest ";

}

else if (Convert.ToInt16(TextBox1.Text) < Convert.ToInt16(TextBox2.Text))

if (Convert.ToInt16(TextBox2.Text) < Convert.ToInt16(TextBox3.Text))

if (Convert.ToInt16(TextBox1.Text) < Convert.ToInt16(TextBox3.Text))
{

Label3.Text = "Number 3 is greatest amoung 3 + Number 2 is the AVERAGE + Number 1 is the smallest ";

//else

//{

//}

}



}
}
Thanks for your Interest. It will be really greatful if you help me with this learning process.
Sushil Mate 17-Oct-12 4:17am    
first of all its two numbers not three.. check OriginalGriff's solution..

What ever book you are using, stop using it now.
The author has little clear idea of the language, and has just produced a general-purpose text slightly (and badly) addapted to the specific langauge.

"Write a function that displays a message indicating the number of times it gets called: For
instance “The function has been called three times”. Write a program that calls this function
10 times from main(). You will need to use a global variable to store the count. A global
variable is declared outside the main() function. for following problems .........."


C# has no idea of "global variables", there are no such thing in the language.

If he means a class level variable within the class containing the "main" method, then that is a very different object indeed, and should not in any way be confused with a global variable - because it isn't, not even slightly.
 
Share this answer
 
Check this one... c# Tutorial for beginners.

Anto
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900