亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ch07rv1.htm

?? good book for learning c++ standard language
?? HTM
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>

<HEAD>
<!-- This document was created from RTF source by rtftohtml version 3.0.1 -->

	<META NAME="GENERATOR" Content="Symantec Visual Page 1.0">
	<META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1">
	<TITLE>Teach Yourself C++ in 21 Days</TITLE>
</HEAD>

<BODY TEXT="#000000" BGCOLOR="#FFFFFF">

<H1></H1>
<P ALIGN="CENTER"><A HREF="ch07.htm" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/htm/ch07.htm"><IMG SRC="../buttons/BLANPREV.GIF" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/buttons/BLANPREV.GIF"
WIDTH="37" HEIGHT="37" ALIGN="BOTTOM" BORDER="0"></A><A HREF="javascript:if(confirm('http://www.mcp.com/sams  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.mcp.com/sams'" tppabs="http://www.mcp.com/sams"><IMG
SRC="../buttons/BLANHOME.GIF" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/buttons/BLANHOME.GIF" WIDTH="37" HEIGHT="37" ALIGN="BOTTOM"
BORDER="0"></A><A HREF="../index.htm" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/index.htm"><IMG SRC="../buttons/BLANTOC.GIF" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/buttons/BLANTOC.GIF"
WIDTH="37" HEIGHT="37" ALIGN="BOTTOM" BORDER="0"></A><A HREF="ch08.htm" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/htm/ch08.htm"><IMG SRC="../buttons/BLANNEXT.GIF" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/buttons/BLANNEXT.GIF"
WIDTH="37" HEIGHT="37" ALIGN="BOTTOM" BORDER="0"></A>
<H2 ALIGN="CENTER"><BR>
<A NAME="Heading1"></A><FONT COLOR="#000077">In Review</FONT></H2>
<P><A NAME="Heading2"></A><FONT SIZE="4" COLOR="#000077"><B>Listing R1.1. Week 1
in Review listing.</B></FONT><FONT COLOR="#0066FF"></FONT>
<PRE><FONT COLOR="#0066FF">1:  #include &lt;iostream.h&gt;
2:
3:  typedef unsigned short int USHORT;
4:  typedef unsigned long int ULONG;
5:  enum BOOL { FALSE, TRUE};
6:  enum CHOICE { DrawRect = 1, GetArea, 
7:     GetPerim, ChangeDimensions, Quit};
8:  // Rectangle class declaration
9:  class Rectangle
10: {
11:    public:
12:      // constructors
13:      Rectangle(USHORT width, USHORT height);
14:      ~Rectangle();
15:
16:      // accessors
17:      USHORT GetHeight() const { return itsHeight; }
18:      USHORT GetWidth() const { return itsWidth; }
19:      ULONG GetArea() const { return itsHeight * itsWidth; }
20:      ULONG GetPerim() const { return 2*itsHeight + 2*itsWidth; }
21:      void SetSize(USHORT newWidth, USHORT newHeight);
22:
23:      // Misc. methods
24:      void DrawShape() const;
25:
26:    private:
27:      USHORT itsWidth;
28:      USHORT itsHeight;
29: };
30:
31: // Class method implementations
32: void Rectangle::SetSize(USHORT newWidth, USHORT newHeight)
33: {
34:    itsWidth = newWidth;
35:    itsHeight = newHeight;
36: }
37:
38:
39: Rectangle::Rectangle(USHORT width, USHORT height)
40: {
41:    itsWidth = width;
42:    itsHeight = height;
43: }
44:
45: Rectangle::~Rectangle() {}
46:
47: USHORT DoMenu();
48: void DoDrawRect(Rectangle);
49: void DoGetArea(Rectangle);
50: void DoGetPerim(Rectangle);
51:
52: void main ()
53: {
54:    // initialize a rectangle to 10,20
55:    Rectangle theRect(30,5);
56:
57:    USHORT choice = DrawRect;
58:    USHORT fQuit = FALSE;
59:
60:    while (!fQuit)
61:    {
62:      choice = DoMenu();
63:      if (choice &lt; DrawRect || choice &gt;  Quit)
64:      {
65:        cout &lt;&lt; &quot;\nInvalid Choice, please try again.\n\n&quot;;
66:        continue;
67:      }
68:      switch (choice)
69:      {
70:      case  DrawRect:
71:        DoDrawRect(theRect);
72:        break;
73:      case GetArea:
74:        DoGetArea(theRect);
75:        break;
76:      case GetPerim:
77:        DoGetPerim(theRect);
78:        break;
79:      case ChangeDimensions:
80:        USHORT newLength, newWidth;
81:        cout &lt;&lt; &quot;\nNew width: &quot;;
82:        cin &gt;&gt; newWidth;
83:        cout &lt;&lt; &quot;New height: &quot;;
84:        cin &gt;&gt; newLength;
85:        theRect.SetSize(newWidth, newLength);
86:        DoDrawRect(theRect);
87:        break;
88:      case Quit:
89:        fQuit = TRUE;
90:        cout &lt;&lt; &quot;\nExiting...\n\n&quot;;
91:        break;
92:      default:
93:        cout &lt;&lt; &quot;Error in choice!\n&quot;;
94:        fQuit = TRUE;
95:        break;
96:      }   // end switch
97:    }     // end while
98: }       // end main
99:
100:
101: USHORT DoMenu()
102: {
103:   USHORT choice;
104:    cout &lt;&lt; &quot;\n\n   *** Menu *** \n&quot;;
105:    cout &lt;&lt; &quot;(1) Draw Rectangle\n&quot;;
106:    cout &lt;&lt; &quot;(2) Area\n&quot;;
107:    cout &lt;&lt; &quot;(3) Perimeter\n&quot;;
108:    cout &lt;&lt; &quot;(4) Resize\n&quot;;
109:    cout &lt;&lt; &quot;(5) Quit\n&quot;;
110:
111:  cin &gt;&gt; choice;
112:  return choice;
113: }
114:
115: void DoDrawRect(Rectangle theRect)
116: {
117:   USHORT height = theRect.GetHeight();
118:   USHORT width = theRect.GetWidth();
119:
120:   for (USHORT i = 0; i&lt;height; i++)
121:   {
122:     for (USHORT j = 0; j&lt; width; j++)
123:       cout &lt;&lt; &quot;*&quot;;
124:     cout &lt;&lt; &quot;\n&quot;;
125:   }
126: }
127:
128:
129: void DoGetArea(Rectangle theRect)
130: {
131:   cout &lt;&lt; &quot;Area: &quot; &lt;&lt;  theRect.GetArea() &lt;&lt; endl;
132: }
133:
134: void DoGetPerim(Rectangle theRect)
135: {
136:   cout &lt;&lt; &quot;Perimeter: &quot; &lt;&lt;  theRect.GetPerim() &lt;&lt; endl;
<TT>137: }</TT>
Output: *** Menu ***
(1) Draw Rectangle
(2) Area
(3) Perimeter
(4) Resize
(5) Quit
1
******************************
******************************
******************************
******************************
******************************

    *** Menu ***
(1) Draw Rectangle
(2) Area
(3) Perimeter
(4) Resize
(5) Quit
2
Area: 150

    *** Menu ***
(1) Draw Rectangle
(2) Area
(3) Perimeter
(4) Resize
(5) Quit
3
Perimeter: 70

    *** Menu ***
(1) Draw Rectangle
(2) Area
(3) Perimeter
(4) Resize
(5) Quit
4

New Width: 10
New height: 8
**********
**********
**********
**********
**********
**********
**********
**********

    *** Menu ***
(1) Draw Rectangle
(2) Area
(3) Perimeter
(4) Resize
(5) Quit
2
Area: 80

    *** Menu ***
(1) Draw Rectangle
(2) Area
(3) Perimeter
(4) Resize
(5) Quit
3
Perimeter: 36

    *** Menu ***
(1) Draw Rectangle
(2) Area
(3) Perimeter
(4) Resize
(5) Quit
5

Exiting...
</FONT></PRE>
<P><FONT COLOR="#000077"><B>Analysis: </B></FONT>This program utilizes most of the
skills you learned this week. You should not only be able to enter, compile, link,
and run this program, but also understand what it does and how it works, based on
the work you've done this week.<BR>
The first six lines set up the new types and definitions that will be used throughout
the program.</P>
<P>Lines 9-29 declare the <TT>Rectangle</TT> class. There are public accessor methods
for obtaining and setting the width and height of the rectangle, as well as for computing
the area and perimeter. Lines 32-43 contain the class function definitions that were
not declared inline.</P>
<P>The function prototypes, for the non-class member functions, are on lines 47-50,
and the program begins on line 52. The essence of this program is to generate a rectangle,
and then to print out a menu offering five options: Draw the rectangle, determine
its area, determine its perimeter, resize the rectangle, or quit.</P>
<P>A flag is set on line 58, and when that flag is not set to <TT>TRUE</TT> the menu
loop continues. The flag is only set to <TT>TRUE</TT> if the user picks Quit from
the menu.</P>
<P>Each of the other choices, with the exception of <TT>ChangeDimensions</TT>, calls
out to a function. This makes the <TT>switch</TT> statement cleaner. <TT>ChangeDimensions</TT>
cannot call out to a function because it must change the dimensions of the rectangle.
If the rectangle were passed (by value) to a function such as <TT>DoChangeDimensions()</TT>,
the dimensions would be changed on the local copy of the rectangle in <TT>DoChangeDimensions()</TT>
and not on the rectangle in <TT>main()</TT>. On Day 8, &quot;Pointers,&quot; and
Day 10, &quot;Advanced Functions,&quot; you'll learn how to overcome this restriction,
but for now the change is made in the <TT>main()</TT> function.</P>
<P>Note how the use of an enumeration makes the <TT>switch</TT> statement much cleaner
and easier to understand. Had the <TT>switch</TT> depended on the numeric choices
(1-5) of the user, you would have to constantly refer to the description of the menu
to see which pick was which.</P>
<P>On line 63, the user's choice is checked to make sure it is in range. If not,
an error message is printed and the menu is reprinted. Note that the <TT>switch</TT>
statement includes an &quot;impossible&quot; default condition. This is an aid in
debugging. If the program is working, that statement can never be reached.
<H3 ALIGN="CENTER"><A NAME="Heading3"></A><FONT COLOR="#000077">Week in Review</FONT></H3>
<P>Congratulations! You've completed the first week! Now you can create and understand
sophisticated C++ programs. Of course, there's much more to do, and next week starts
with one of the most difficult concepts in C++: pointers. Don't give up now, you're
about to delve deeply into the meaning and use of object-oriented programming, virtual
functions, and many of the advanced features of this powerful language.</P>
<P>Take a break, bask in the glory of your accomplishment, and then turn the page
to start Week 2.</P>
<P ALIGN="CENTER"><BR>
<BR>
<A HREF="ch07.htm" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/htm/ch07.htm"><IMG SRC="../buttons/BLANPREV.GIF" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/buttons/BLANPREV.GIF" WIDTH="37"
HEIGHT="37" ALIGN="BOTTOM" BORDER="0"></A><A HREF="javascript:if(confirm('http://www.mcp.com/sams  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.mcp.com/sams'" tppabs="http://www.mcp.com/sams"><IMG
SRC="../buttons/BLANHOME.GIF" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/buttons/BLANHOME.GIF" WIDTH="37" HEIGHT="37" ALIGN="BOTTOM"
BORDER="0"></A><A HREF="../index.htm" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/index.htm"><IMG SRC="../buttons/BLANTOC.GIF" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/buttons/BLANTOC.GIF"
WIDTH="37" HEIGHT="37" ALIGN="BOTTOM" BORDER="0"></A><A HREF="ch08.htm" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/htm/ch08.htm"><IMG SRC="../buttons/BLANNEXT.GIF" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/buttons/BLANNEXT.GIF"
WIDTH="37" HEIGHT="37" ALIGN="BOTTOM" BORDER="0"></A><A HREF="#heading1"><IMG SRC="../buttons/BLANTOP.GIF" tppabs="http://petunia.atomki.hu/pio/Manuals/english/0-672/0-672-31070-8/buttons/BLANTOP.GIF"
WIDTH="37" HEIGHT="37" ALIGN="BOTTOM" BORDER="0"></A>


</BODY>

</HTML>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久亚洲一区二区三区四区| 尤物视频一区二区| 中文字幕在线一区免费| 亚洲成av人片在线观看| 成人自拍视频在线| 欧美成人免费网站| 性久久久久久久久久久久| 国产成人8x视频一区二区| 91精品国产黑色紧身裤美女| 亚洲欧美日韩电影| 国产精品一二二区| 欧美不卡一区二区三区| 午夜精品久久久| 在线看国产日韩| 亚洲欧美在线观看| 福利一区二区在线| 久久久久久免费毛片精品| 日韩vs国产vs欧美| 欧美日韩国产大片| 亚洲最新在线观看| 色偷偷久久一区二区三区| 欧美国产综合色视频| 国产一区二区在线影院| 欧美一区二区免费| 日产国产高清一区二区三区| 欧美日韩日日摸| 亚洲综合999| 欧美日免费三级在线| 一区二区三区产品免费精品久久75| 成人高清av在线| 国产女人aaa级久久久级 | 精品嫩草影院久久| 热久久久久久久| 欧美精品免费视频| 三级欧美韩日大片在线看| 777久久久精品| 日韩激情视频网站| 欧美岛国在线观看| 韩国成人精品a∨在线观看| 亚洲精品一区二区精华| 国产一区二区不卡| 国产精品毛片高清在线完整版| 成人免费av在线| 亚洲日本一区二区| 精品国产伦一区二区三区观看体验| 天涯成人国产亚洲精品一区av| 欧美日韩成人综合| 免费成人在线视频观看| 精品免费视频一区二区| 国产91丝袜在线播放| 国产精品青草综合久久久久99| aaa国产一区| 亚洲国产精品久久一线不卡| 欧美精品九九99久久| 免费成人在线网站| 欧美激情一区二区三区不卡| 91美女视频网站| 日韩电影一二三区| 久久精品欧美日韩| 91免费看视频| 麻豆成人综合网| 国产精品视频免费看| 欧美午夜电影网| 激情综合五月婷婷| 亚洲精品免费在线| 日韩亚洲欧美高清| 国产成人精品亚洲日本在线桃色| 中文字幕在线观看不卡视频| 欧美日韩dvd在线观看| 国产一区欧美二区| 一区二区欧美视频| 久久精品人人做人人综合 | 久久久99久久精品欧美| 不卡一卡二卡三乱码免费网站| 一区二区三区在线看| 精品久久久久久亚洲综合网 | 成人免费在线播放视频| 欧美久久一二区| 成人丝袜18视频在线观看| 亚洲va欧美va天堂v国产综合| 国产日韩高清在线| 制服丝袜在线91| 91视频免费播放| 国产一区二区三区日韩| 偷拍与自拍一区| 最新热久久免费视频| 久久欧美一区二区| 欧美日韩国产一级| 91麻豆免费看片| 国产精品一级片| 日韩av电影免费观看高清完整版在线观看| 国产精品久久一级| 精品国产91洋老外米糕| 欧美日韩久久不卡| 在线亚洲欧美专区二区| 成人夜色视频网站在线观看| 久久99精品一区二区三区| 亚洲成人精品影院| 国产精品一二三区| 免费观看30秒视频久久| 亚洲午夜精品网| 亚洲另类春色校园小说| 国产精品毛片久久久久久久| 久久这里只有精品首页| 欧美精品一区二| 精品久久久久一区| 久久综合五月天婷婷伊人| 日韩色在线观看| 7777精品久久久大香线蕉| 欧美三区免费完整视频在线观看| 99re成人在线| 色综合av在线| 一本一道久久a久久精品综合蜜臀| 成人激情午夜影院| 国产91在线观看丝袜| 粉嫩欧美一区二区三区高清影视 | 精品国产乱码久久久久久闺蜜| 欧美高清视频不卡网| 欧美日韩大陆在线| 欧美日韩精品欧美日韩精品一综合| 在线观看成人小视频| 欧美亚洲一区二区三区四区| 色老汉一区二区三区| 在线亚洲一区观看| 欧美一a一片一级一片| 欧美日韩视频在线第一区| 欧美丝袜丝nylons| 3d成人动漫网站| 欧美精品一区二区三区一线天视频 | 国产精品白丝av| 高清成人在线观看| 99国产精品国产精品毛片| 色天天综合色天天久久| 欧美伦理电影网| 精品国产麻豆免费人成网站| 国产欧美日韩视频一区二区| 国产精品久久久久久久久免费桃花| 人人狠狠综合久久亚洲| 国产麻豆精品视频| 色综合久久久网| 日韩亚洲欧美一区二区三区| 久久精品亚洲麻豆av一区二区| 国产精品久久福利| 亚洲一区在线看| 激情丁香综合五月| 97久久精品人人做人人爽| 91精品国产综合久久久久久漫画| 337p粉嫩大胆噜噜噜噜噜91av| 中文字幕一区视频| 丝袜亚洲精品中文字幕一区| 国产成人午夜高潮毛片| 91国偷自产一区二区开放时间| 日韩视频中午一区| 国产精品美女久久福利网站| 午夜精品国产更新| 成人高清免费观看| 日韩一区二区免费电影| 国产精品三级久久久久三级| 丝袜国产日韩另类美女| 成人看片黄a免费看在线| 4438x成人网最大色成网站| 欧美激情综合在线| 日本成人中文字幕在线视频| 成人动漫精品一区二区| 91精品国产综合久久香蕉麻豆| 国产日韩欧美激情| 肉丝袜脚交视频一区二区| 99久久综合精品| 精品99久久久久久| 首页亚洲欧美制服丝腿| 99国产一区二区三精品乱码| 精品久久久久久久久久久久包黑料| 亚洲卡通动漫在线| 懂色av中文字幕一区二区三区| 中文字幕乱码一区二区免费| 欧美a级理论片| 在线免费不卡电影| 亚洲欧洲日韩在线| 国产精品99精品久久免费| 日韩一区二区免费高清| 亚洲国产综合人成综合网站| 成人av在线资源网站| 久久一夜天堂av一区二区三区| 天天综合色天天| 日本精品一级二级| 亚洲男帅同性gay1069| 成人午夜短视频| 亚洲国产精品精华液ab| 国产一区二区三区最好精华液 | 91老师国产黑色丝袜在线| 久久精品一区二区三区不卡牛牛| 麻豆成人av在线| 欧美一二三区精品| 日韩电影在线免费观看| 欧美日韩国产一级| 日本中文字幕不卡| 777奇米成人网| 日本伊人午夜精品| 欧美一区二区精美| 久久99国产精品麻豆|