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

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.

主站蜘蛛池模板: 聂荣县| 繁峙县| 麻城市| 菏泽市| 定南县| 云霄县| 三明市| 健康| 元江| 含山县| 谢通门县| 祥云县| 泌阳县| 抚顺县| 陕西省| 惠安县| 雷州市| 英超| 扶沟县| 鄂温| 阜南县| 浦江县| 泾阳县| 休宁县| 闽侯县| 商都县| 许昌市| 蓝山县| 镇平县| 普宁市| 中山市| 龙游县| 宁蒗| 朝阳县| 东阿县| 襄垣县| 平昌县| 资中县| 济宁市| 进贤县| 衡水市|