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

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.

主站蜘蛛池模板: 宜章县| 乌鲁木齐市| 犍为县| 荆州市| 吉木乃县| 茌平县| 会东县| 南雄市| 安岳县| 洛南县| 馆陶县| 安龙县| 莲花县| 佛坪县| 郴州市| 武川县| 灵山县| 乌兰察布市| 长白| 肇源县| 井陉县| 伊春市| 乌兰察布市| 尼玛县| 元谋县| 炉霍县| 横山县| 蒙自县| 伽师县| 巴中市| 北宁市| 翁牛特旗| 古交市| 新沂市| 东平县| 宿松县| 泾川县| 壤塘县| 志丹县| 错那县| 翁源县|