请问谁能帮我解说一下arcgis server API for javascript 的发展前景和开发优势?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了请问谁能帮我解说一下arcgis server API for javascript 的发展前景和开发优势?相关的知识,希望对你有一定的参考价值。

参考技术A for silverlight, for flex esri 公司停止跟新了,以后主要发展 for javascript ,所以前景是一片大好。
优势主要是不需要插件吧,以后还会持续跟新。

谁能帮我检查一下我的BMI计算器? (C#)

我刚刚开始编程一周前,我的第一个任务是编写BMI计算器。

推出时应该看起来像这样:

    BMI Calculator
    Your weight in kg: x 
    Your height in cm: x
    Gender (m/f): x

-> You are underweight/normal/overweight

到目前为止,这是我的代码:

            Console.WriteLine("BMI Calculator");
            Console.WriteLine("===========");
            Console.WriteLine();

            Console.Write("Weight in kg: ");
            int kg;
            kg = Convert.ToInt32(Console.ReadLine());

            Console.Write("Height in cm: ");
            int m;
            m = Convert.ToInt32(Console.ReadLine());

            Console.Write("Gender (m/f):");
            string Geschlecht = Console.ReadLine();

            int BMI;
            BMI = kg / (m / 100) * (m / 100);

            if (BMI < 19 & Gender == "f")
            { Console.WriteLine("-> Underweight"); }
            if (BMI >= 19 & BMI <= 24 & Gender == "f") 
            { Console.WriteLine("-> Normal"); }
            if (BMI > 24 & Geschlecht == "f")
            { Console.WriteLine("-> Overweight"); }

            if (BMI < 20 & Gender == "m")
            { Console.WriteLine("-> Underweight"); }
            if (BMI >= 20 & BMI <= 25 & Gender == "m")
            { Console.WriteLine("-> Normal"); }
            if (BMI > 25 & Gendert == "m")
            { Console.WriteLine("-> Overweight"); }

            Console.ReadLine();

我不确定我的代码有什么问题,但每当我输入60公斤,170厘米和男性时,我都会超重,即使我应该恢复正常。实际上超过10公斤的东西也是如此。

PS:我真的是编程的初学者,所以我为编程术语的命令道歉。

为了您的方便:

http://i.stack.imgur.com/admqr.png

提前致谢!

答案

当你这样做时:

BMI = kg / (m / 100) * (m / 100);

m是一个int,你将做整数除法,在这种情况下170 / 100 = 1。正如User1551892指出的那样,您需要更加具体地了解计算顺序。

尝试:

double BMI = kg / ( ( m / 100.0 ) * ( m / 100.0 ) );

这将迫使它做浮点除法,应该会得到更好的结果。

此外,您可以使用Math.Pow避免m / 100.0两次:

double BMI = kg / Math.Pow( m / 100.0, 2 );
另一答案

请检查此行:

BMI = kg / (m / 100) * (m / 100);

它应该是这样的:

BMI = kg / ((m / 100) * (m / 100)) ;
另一答案

仅供参考FYI新堆栈的交换门户网站:codereview.stackexchange.com

应该是更好的地方要求审查

另一答案

LOGIX.ASPX

using System;
using System.Configuration;
using System.Data.SqlClient;

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

    }

    protected void btnLogin_Click(object sender, EventArgs e)
    {

        bool blnLoginOK = false;

        //Verbindung zur DB herstellen
        SqlConnection conDBTodo = new SqlConnection(ConfigurationManager.ConnectionStrings["conStrLogin"].ConnectionString);

        //SqlCommand vorbereiten, Verbindung zur Tabelle
        SqlCommand comDemoSelect = new SqlCommand();
        comDemoSelect.Connection = conDBTodo;

        //comDemoSelect.CommandType = comm
        comDemoSelect.CommandText = "SELECT ID FROM tabUser WHERE Email=@Email AND Passwort=@Passwort";
        comDemoSelect.Parameters.AddWithValue("@Email", this.txtMail.Text);
        comDemoSelect.Parameters.AddWithValue("@Passwort", this.txtPW.Text);
        comDemoSelect.Connection.Open();

        //Datareader um Daten anzuzeigen
        SqlDataReader drTodo = comDemoSelect.ExecuteReader();

        //Datenausgabe in Labelfeld mit Datareader
        blnLoginOK = drTodo.HasRows; //Sind Datensätze vorhanden?

        //Schliessen aller Verbindungen
        drTodo.Dispose();
        drTodo.Close();
        comDemoSelect.Dispose();
        comDemoSelect.Connection.Close();
        conDBTodo.Dispose();
        conDBTodo.Close();

        if (blnLoginOK == true)
        {
            Session["LoggedIn"] = "true";
            Response.Redirect("Secure.aspx");
        }
        else
        {
            Response.Redirect("Login.aspx");
        }

    }

    protected void btnReg_Click(object sender, EventArgs e)
    {
        Response.Redirect("Registration.aspx");
    }

    protected void btnWeg_Click(object sender, EventArgs e)
    {

            //Verbindung zur DB herstellen
            SqlConnection conDBTodoDelete = new SqlConnection(ConfigurationManager.ConnectionStrings["conStrLogin"].ConnectionString);

            //SqlCommand vorbereiten, Verbindung zur Tabelle mit SQL - Befehl
            SqlCommand comDemoDelete = new SqlCommand("DELETE FROM tabUser WHERE Email = @Email AND Passwort = @Passwort");
            comDemoDelete.Connection = conDBTodoDelete;
            comDemoDelete.Parameters.AddWithValue("@Email", this.txtMail.Text);
            comDemoDelete.Parameters.AddWithValue("@Passwort", this.txtPW.Text);

            comDemoDelete.Connection.Open();
            comDemoDelete.ExecuteNonQuery();
            comDemoDelete.Connection.Close();
            comDemoDelete.Dispose();
            conDBTodoDelete.Dispose();
            conDBTodoDelete.Close();

            txtMail.Text = "Sie haben nun Ihren Account gelöscht!";
            return;
    }
}



REGISTRATION.ASPX

using System;
using System.Configuration;
using System.Data.SqlClient;


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

    }

    protected void btnRegistrierung_Click(object sender, EventArgs e)
    {
        //Verbindung zur DB herstellen
        SqlConnection conDBTodo = new SqlConnection(ConfigurationManager.ConnectionStrings["conStrLogin"].ConnectionString);

        //SqlCommand vorbereiten, Verbindung zur Tabelle mit SQL - Befehl
        SqlCommand comDemoInsert = new SqlCommand("INSERT INTO tabUser(Benutzername, Email, Passwort) VALUES (@Benutzername, @Email, @Passwort)");
        comDemoInsert.Connection = conDBTodo;
        comDemoInsert.Parameters.AddWithValue("@Benutzername", this.txtBen.Text);
        comDemoInsert.Parameters.AddWithValue("@Email", this.txtMail.Text);
        comDemoInsert.Parameters.AddWithValue("@Passwort", this.txtPW.Text);

        comDemoInsert.Connection.Open();
        comDemoInsert.ExecuteNonQuery();
        comDemoInsert.Connection.Close();
        comDemoInsert.Dispose();

        conDBTodo.Dispose();
        conDBTodo.Close();

        Response.Redirect("Login.aspx");
    }

    protected void btnBack_Click(object sender, EventArgs e)
    {
        Response.Redirect("Login.aspx");
    }
}
另一答案
protected void btnGoo_Click(object sender, EventArgs e)
    {

        this.txtErgebnis.BackColor = System.Drawing.Color.White;
        this.txtErgebnis.Text = "";
        this.txtErgebnis.ForeColor = System.Drawing.Color.White;
        //variablen Definieren
        double dblGroesse = 0;
        double dblGewicht = 0;
        double dblErgebnis = 0;

        if (Double.TryParse(txtGroesse.Text, out dblGroesse) == false) {
            txtGroesse.Text = "Geben Sie ihre Grösse ein";
            return;
        }

        if (Double.TryParse(txtGewicht.Text, out dblGewicht) == false)
        {
            txtGewicht.Text = "Geben Sie ihr Gewicht ein";
            return;
        }


        dblErgebnis = dblGewicht / (dblGroesse * dblGroesse);
        txtErgebnis.Text = Convert.ToString (dblErgebnis);

            if (dblErgebnis <= 16)
            {
            this.txtErgebnis.BackColor = System.Drawing.Color.Coral;
            this.txtErgebnis.ForeColor = System.Drawing.Color.LightGoldenrodYellow;
        }

        else if (dblErgebnis <= 25)
        {
            this.txtErgebnis.BackColor = System.Drawing.Color.DarkRed;
            this.txtErgebnis.ForeColor = System.Drawing.Color.DarkSlateGray;
        }
}
}

以上是关于请问谁能帮我解说一下arcgis server API for javascript 的发展前景和开发优势?的主要内容,如果未能解决你的问题,请参考以下文章

谁能帮我翻译一下

谁能帮我使Windows Server 2003 R2 Standard Edition Service Pack 2 识别4G以上内存重奖300积分!

谁能帮我改装一下,默认的时候把二级菜单隐藏,需要显示的时候点一下一级分类就可

谁能帮我使Windows Server 2003 R2 Standard Edition Service Pack 2 识别4G以上内存重奖300积分!

谁能帮我解释一下 FBX 格式?

我的ARCGIS9.3运行的时候出现FLEXnet licensing error:-97,121,请问能不能帮我解决一下