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

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.

主站蜘蛛池模板: 清镇市| 南丰县| 简阳市| 云安县| 饶河县| 萨嘎县| 伊金霍洛旗| 邳州市| 大渡口区| 白沙| 融水| 济源市| 开远市| 石家庄市| 宁陵县| 临颍县| 雷州市| 普格县| 桐梓县| 永平县| 舟曲县| 葵青区| 叶城县| 措美县| 黑水县| 铜鼓县| 肥西县| 海宁市| 霍州市| 阜新市| 汤阴县| 镇江市| 阿图什市| 西盟| 合川市| 海淀区| 柳州市| 南投市| 嘉祥县| 曲阳县| 许昌市|