Blogtrottr
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 已解決
Yahoo!奇摩知識+ - 分類問答 - 電腦網路 - 已解決 
LSAT prep from HLS-educated instructors

LSATMax includes video lessons, unlimited personal attention & support, and over 6,000 real questions from previous LSAT’s. Enroll for just $299.
From our sponsors
C# oop 寫計算程式有點困擾 (20點)
Nov 10th 2013, 15:23

小弟我 最近在涉獵C#
在寫 OOP 物件導入程式的設計
但有些不解程式的問題

例如要寫 加法的類別 如下

public class CountGuo
{
public double add_result { set; get; }
}

// define add method
public double add (double _op1, double _op2)
{
add_result = _op1 + _op2;
return add_result;

上述 物件類別

下面則是 介面的程式

private void button1_Click(object sender, EventArgs e)
{
CountGuo weict = new CountGuo();
weict.add_result = (double.Parse(tex1.Text + tex2.Text));
tex3.Text = (weict.add_result).ToString();

本來意思是要 textbox + textbox2 的數字相加 然後出現在 textbox3

例如 10+5 =15

不過 上述的程式 誤解成 把box1+box2 加起來 例如 10+10=1010

希望能幫小弟找出錯誤的地方 讓我加以改進

This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers. Five Filters recommends:

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions
arrow
arrow
    全站熱搜

    jmuko99 發表在 痞客邦 留言(0) 人氣()