官术网_书友最值得收藏!

Modifying the program for an additional type of comparison

Now, go back to Default.aspx and, in the next stage, in the Design view, we will also compare those values. For this, double-click on the Exchange and Compare button again and add the following beneath the last line we entered:

sampLabel.Text += GenMethods.Compare<double>(x, y);

Remember that the way we designed Compare, it returns a string that returns one of the two values, depending on the specifics. So, in this line we will compare double; so you put that in there and then the two values will be x, y.

Let's give it a shot in your browser. Click on the Exchange and Compare button once again. The new results are shown in Figure 2.2.5:

Figure 2.2.5: Results of the modified program run

Now, x is 25 and y is 34. When you exchange the values, x is 34 and y is 25. Further, 34 is certainly more than 25. It looks really nice and professional.

主站蜘蛛池模板: 黔西县| 天等县| 道真| 彭阳县| 钟祥市| 通江县| 沁源县| 庐江县| 龙里县| 五峰| 长兴县| 全椒县| 四川省| 同德县| 同江市| 义乌市| 靖江市| 盖州市| 额尔古纳市| 屯昌县| 云安县| 安仁县| 高唐县| 滦平县| 峡江县| 辽源市| 湘西| 东乡族自治县| 乌拉特前旗| 山丹县| 海原县| 吉安市| 宜君县| 桑植县| 万荣县| 东港市| 石阡县| 方山县| 项城市| 兴安县| 读书|