




已閱讀5頁,還剩1頁未讀, 繼續(xù)免費閱讀
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
電大 面向?qū)ο蟪绦蛟O(shè)計期末復(fù)習指導 小抄 一、單項選題 1 字符串 a+b=12 n 的長度為( )。 A. 6 B. 7 C. 8 D. 9 2. x0 | y=5 的相反表達式為( )。 A. x=0 | y!=5 B. x0 | y!=5 D. x0 & y=5 3. 循環(huán)體有可能一次都不執(zhí)行的語句為 ( ) 。 A. for 循環(huán) B. switch 循環(huán) C. do循環(huán) D. 任一種循環(huán) 4. 函數(shù)調(diào)用 func(exp1,exp2,exp3),exp4,exp5)中所含實參的個數(shù)為 ( )個。 A. 1 B. 2 C. 3 D. 5 5. 假定 p是具有 int*類型的指針變量,則給 p賦值的正確語句為( )。 A. p=new int; B. p=new int10; C. p=new int*; D. p=new int*; 6 假定一個二維數(shù)組的定義語句為 int a34=3,4,2,8,6; ,則元素 a21的 值為( )。 A. 2 B. 4 C. 6 D. 0 7. 假定一個類的構(gòu)造函數(shù)為 A(int aa=1, int bb=0) a=aa; b=bb; ,則執(zhí)行 A x(0); 語句后, x.a和 x.b的值分別為 ( )。 A. 0和 0 B. 0和 1 C. 1 和 0 D. 1 和 1 8. 假定 AA為一個類, int a()為該類的一個成員函數(shù),若該成員函數(shù)在類定義體外定義,則函數(shù)頭為( )。 A int AA:a() B int AA:a() C AA:a() D AA:int a() 9 關(guān)于插入運算符 的重載,下列說法不正確的是( )。 A. 運算符函數(shù)的返回值類型是 ostream & 。 B. 重載的運算符必須定義為類的成員函數(shù)。 C. 運算符函數(shù)的第一個參數(shù)的類型是 ostream & 。 D. 運算符函數(shù)有兩個參數(shù)。 10. 假定 AB 為一個類, px 為指向該類的一個含有 n 個對象的動態(tài)數(shù)組的指針,則執(zhí)行 delete px; 語句時共調(diào)用該類析構(gòu)函數(shù)的次數(shù)為 ( )。 A. 0 B. 1 C. n D. n+1 二、填空題 1. 當使用 _保留字作為函數(shù)類型時,該函數(shù)不返 回任何值。 2. 執(zhí)行 char *p=new char(x) 操作后, p所指向的數(shù)據(jù)對象的值為 _。 3. 當在程序中執(zhí)行到 _語句時,將結(jié)束本次循環(huán),執(zhí)行下一次循環(huán)語句。 4. 一個指針類型的對象占用內(nèi)存的 _個字節(jié)的存儲空間。 5. 假定用戶為類 AB定義了一個構(gòu)造函數(shù) AB(int aa) a=aa; ,則系統(tǒng)(會 /不會) _為該類自動定義一個無參構(gòu)造函數(shù) AB() 。 6 已知語句 couts; 的輸出是 hello,world ,則 執(zhí)行語句 couts+%; 的輸出結(jié)果為 _。 7. 如果一個派生類的基類不止一個,則這種繼承稱為 _。 8. 重載一個函數(shù)的條件是:該函數(shù)必須在參數(shù)的個數(shù)或參數(shù)對應(yīng)的 _上與其它同名函數(shù)不相同。 9. 假定用戶為類 AB定義了一個構(gòu)造函數(shù) AB(int aa) a=aa; ,則系統(tǒng)(會 /不會) _為該類自動定義一個無參構(gòu)造函數(shù) AB() 。 10假定用戶為類 AB 定義了一個構(gòu)造函數(shù) AB(int aa=0):a(aa) ,則定義該類的對象時, 可以有 _種不同的定義格式。 三、程序填充題,根據(jù)題意在橫線上填寫合適的內(nèi)容。 1. 已知一個類的定義如下: #include class AA int a10; int n; public: void SetA(int aa, int nn); /初始化函數(shù) int MaxA(); /從數(shù)組 a中前 n個元素中查找最大值 void SortA(); /采用選擇排序的方法對數(shù)組 a中前 n個元素 進行從 小到大排序 ; 該類中 MaxA()函數(shù)的實現(xiàn)如下,請在標號位置補充適當?shù)膬?nèi)容。 int _(1)_ int x=a0; for(int i=1; ix) _(2)_; _(3)_; (1) (2) (3) 2. 類 A的定義 class A int *a; int n; int MaxLen; public: A(): a(0), n(0), MaxLen(0) /無參構(gòu)造函數(shù) A(int *aa, int nn, int MM) /帶參構(gòu)造函數(shù) n=nn; MaxLen=MM; if(nMaxLen) exit(1); a=new intMaxLen; for(int i=0; in; i+) _( 1) _; A()_( 2) _; ; (1) (2) 3 在下面一段類定義中, Derived類公有繼承了基類 Base。需要填充的函數(shù)由注釋內(nèi)容給 出了功能。 class Base private: int mem1,mem2; /基類的數(shù)據(jù)成員 public: Base(int m1,int m2) mem1=m1; mem2=m2; void output()coutmem1 mem2 ; ; class Derived: public Base private: int mem3; /派生類本身的數(shù)據(jù)成員 public: /構(gòu)造函數(shù) ,由 m1和 m2分別初始化 mem1和 mem2,由 m3 初始化 mem3 Derived(int m1,int m2, int m3); /輸出 mem1,mem2和 mem3數(shù)據(jù)成員的值 void output() _(1)_; coutmem3endl; ; Derived:Derived(int m1,int m2, int m3): _(2)_ _(3)_; (1) (2) (3) 四、理解問答題,寫出程序運行結(jié)果或程序(或函數(shù))所能實現(xiàn)的功能。 1 #include double f1(int n) double sign=1,s=1; for(int i=2;ia; coutf1(a)endl; 函數(shù)功能: 2 char* f8(char* str1, const char* str2) int i=0,j=0; while(str1i) i+; while(str2j) str1i+=str2j+ ; str1i=0; return str1; 函數(shù)功能: 3 #include void f2(int& x, int& y) int z=x; x=y; y=z; void f3(int* x, int* y) int z=*x; *x=*y; *y=z; void main() int x=10,y=26; coutx,y=x, yendl; f2(x,y); coutx,y=x, yendl; f3(&x,&y); coutx,y=x, yendl; x+; y-; f2(y,x); coutx,y=x, yendl; 運行結(jié)果 : 五、 程序改錯,請根據(jù)程序段或函數(shù)模塊的功能改寫個別地方的錯誤。 下面是分數(shù)類 fract的定義及測試主程序,在類定義及其友元函數(shù)定義中有兩處錯誤,更正錯誤后程序應(yīng)顯示41/28,請指出錯誤所在行的行號并給出改正意見。 class fract int den; /分子 int num; /分母 public: fract(int d=0,int n=1):den(d),num(n) /1 行 friend fract &operator+=(fract,fract&); /2行 void show() coutden/num; /3 行 ; /4 行 friend fract &operator+=(fract f1,fract f2) /5 行 /7 行 f1.den=f1.den*f2.num+f1.num*f2.den; /8 行 f1.num*=f2.num; /9 行 return f1; /10 行 void main() fract fr(3,4); fr+=fract(5,7); fr.show(); 錯誤行的行號為 _和 _。( 2分) 分別改正為 _( 4分) 和 _( 4分) 參考答案: 一、單選題 1. B 2. B 3.A 4.C 5. D 6. D 7. A 8.A 9. B 10. C 二、填空題 1. void 2. x 3.contiune 4. 4 5. 不會 6. ple 7. 多繼承(或多重繼承) 8. 類型 9. 不會 10. 2 三、程序填充題,根據(jù)題意在橫線上填寫合適的內(nèi)容。 評分標準:每空 4分 1. (1) AA:MaxA() (2) x=ai (3) return x 2. ( 1) ai=aai ( 2) delete a 3. (1) Base:output() (2) Base(m1,m2) (3) mem3=m3 四、理解問答題,寫出程序運行結(jié) 果或程序(或函數(shù))所能實現(xiàn)的功能。 1. 計算并輸出 1+aiii2 2)1(的值,其中 a的值由鍵盤輸入。 2.實現(xiàn) strcat函數(shù)的功能,把 str2所指字符串連接到 str1所指字符串的后面,并返回 str1指針。 3. x,y=10, 26 x,y=26, 10 x,y=10, 26 x,y=25, 11 五、 程序改錯,請根據(jù)程序段或函數(shù)模塊的功能改寫個別地方的錯誤。 2 5 friend fract &operator+=(fract&,fract); fract &operator+=(fract &f1,fract f2); 請您刪除一下內(nèi)容, O( _ )O謝謝! 2015年中央電大期末復(fù)習考試小抄大全,電大期末考試必備小抄,電大考試必過小抄 After earning his spurs in the kitchens of The Westin, The Sheraton, Sens on the Bund, and a sprinkling of other top-notch venues, Simpson Lu fi nally got the chance to become his own boss in November 2010. Sort of. The Shanghai-born chef might not actually own California Pizza Kitchen (CPK) but he is in sole charge of both kitchen and frontof- house at this Sinan Mansionsstalwart. Its certainly a responsibility to be the head chef, and then to have to manage the rest of the restaurant as well, the 31-year-old tells Enjoy Shanghai. In hotels, for example, these jobs are strictly demarcated, so its a great opportunity to learn how a business operates across the board. It was a task that management back in sunny California evidently felt he was ready for, and a vote of confi dence from a company that, to date, has opened 250 outlets in 11 countries. And for added pressure, the Shanghai branch was also CPKs China debut. For sure it was a big step, and unlike all their other Asia operations that are franchises, they decided to manage it directly to begin with, says Simpson. Two years ago a private franchisee took over the lease, but the links to CPK headquarters are still strong, with a mainland-based brand ambassador on hand to ensure the business adheres to its ethos of creating innovative, hearth-baked pizzas, a slice of PR blurb that Simpson insists lives up to the hype. They are very innovative, he says. The problem with most fast food places is that they use the same sauce on every pizza and just change the toppings. Every one of our 16 pizza sauces is a unique recipe that has been formulated to complement the toppings perfectly. The largely local customer base evidently agrees and on Saturday and Sunday, at least, the place is teeming. The kids-eat-for-free policy at weekends is undoubtedly a big draw, as well as is the spacious second-fl oor layout overlooked by a canopy of green from Fuxing Park over the road. The company is also focusing on increasing brand recognition and in recent years has taken part in outside events such as the regular California Week. Still, the sta are honest enough to admit that business could be better; as good, in fact, as in CPKs second outlet in the popular Kerry Parkside shopping mall in Pudong. Sinan Mansions has really struggled to get the number of visitors that were envisaged when it first opened, and it hasnt been easy for any of the tenants here, adds Simpson. Were planning a third outlet in the city in 2015, and we will probably choose a shopping mall again because of the better foot traffic. The tearooms once frequented by Coco Chanel and Marcel Proust are upping sticks and coming to Shanghai, Xu Junqian visits the Parisian outpost with sweet treats. One thing the century-old Parisian tearoom Angelina has shown is that legendary fashion designer Coco Chanel not only had style and glamor but also boasted great taste in food, pastries in particular. One of the most popular tearooms in Paris, Angelina is famous for having once been frequented by celebrities such as Chanel and writer Marcel Proust. Now Angelina has packed up its French ambience, efficient service, and beautiful, comforting desserts and flown them to Shanghai. At the flagship dine-in and take-out space in Shanghai, everything mimics the original tearoom designed from the beginning of the 20th century, in Paris, the height of Belle Epoque. The paintings on the wall, for example, are exactly the same as the one that depicts the landscape of southern France, the hometown of the owner; and the small tables are intentional imitations of the ones that Coco Chanel once sat at every afternoon for hot chocolate. The famous hot chocolate, known as LAfricain, is a luxurious mixture of four types of cocoa beans imported from Africa, blended in Paris and then shipped to Shanghai. Its sinfully sweet, rich and thick as if putting a bar of melting chocolate directly on the tongue and the fresh whipped cream on the side makes a light, but equally gratifying contrast. It is also sold in glass bottles as takeaway. The signature Mont-Blanc chestnut cake consists of three parts: the pureed chestnut on top, the vanilla cream like stuffing, and the meringue as base. Get all three layers in one scoop, not only for the different textures but also various flavors of sweetness. The dessert has maintained its popularity for a century, even in a country like France, perhaps the worlds most competitive place for desserts. A much overlooked pairing, is the Paris-New York choux pastry and N226 chocolate flavored tea. The choux pastry is a mouthful of airy pecan-flavored whipped cream, while the tea, a blend of black teas from China and Ceylon, cocoa and rose petals, offers a more subtle fragrance of flowers and chocolate. Ordering these two items, featuring a muted sweetness, makes it easier for you to fit into your little black dress. Breakfast, brunch, lunch and light supper are also served at the tearoom, a hub of many cultures and takes in a mix of different styles of French cuisines, according to the management team. The semi-cooked foie gras terrine, is seductive and deceptive. Its generously served at the size and shape of a toast, while the actual brioche toast is baked into a curved slice dipped with fig chutney. The flavor, however, is honest: strong, smooth and sublime. And you dont actually need the toast for crunchiness. This is the season for high teas, with dainty cups of fine china and little pastries that appeal to both visual and physical appetites. But there is one high tea with a difference, and Pauline D. Loh finds out just exactly why it is special. Earl Grey tea and macarons are all very well for the crucial recuperative break in-between intensive bouts of holiday season shopping. And for those who prefer savory to sweet, there is still the selection of classic Chinese snacks called dim sum to satisfy and satiate. High tea is a meal to eat with eye and mouth, an in-between indulgence that should be light enough not to spoil dinner, but sufficiently robust to take the edge off the hunger that strikes hours after lunch. The afternoon tea special at Shang-Xi at the Four Seasons Hotel Pudong has just the right elements. It is a pampering meal, with touches of luxury that make the high tea session a treat in itself. Whole baby abalones are braised and then topped on a shortcrust pastry shell, a sort of Chinese version of the Western vol-au-vent, but classier. Even classier is the dim sum staple shrimp dumpling or hargow, upgraded with the addition of slivers of midnight dark truffles. This is a master touch, and chef Simon Choi, who presides unchallenged at Shang-Xi, has scored a winner again. Sweet prawns and aromatic truffles whats not to love? His masterful craftsmanship is exhibited in yet another pastry a sweet pastry that is shaped to look like a walnut, but which you can put straight into the mouth. It crumbles immediately, and the slightly sweet, nutty morsel is so easy to eat youll probably reach straight for another. My favorite is the dessert that goes by the name yangzhi ganlu, or ambrosia from the gods. The hotel calls it chilled mango cream with sago, pomelo and birds nest made with ingredients that resonate with every female soul. It does taste like ambrosia, with the sweet-sour fragrance of the mango
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 造船電焊工合同協(xié)議
- 沃柑種植協(xié)議書
- 校園責任協(xié)議書
- 欺騙文字協(xié)議書
- 正規(guī)借房協(xié)議書
- 車輛合伙經(jīng)營合同協(xié)議
- 高效沖刺2024年民用航空器維修人員執(zhí)照考試試題及答案
- 消防安全問題的政策建議試題及答案
- 財務(wù)透明與投資者信任試題及答案
- 職場禮儀規(guī)范與實務(wù)
- 京東考試答案
- 畢業(yè)論文指導教師指導記錄6篇
- 跨越架施工方案
- 古書院礦1.2Mt新井設(shè)計(機械CAD圖紙)
- 財產(chǎn)和行為稅納稅申報表
- 人民幣全版(錢幣)教學打印版word版
- 貝氏體鋼軌超高周疲勞行為的研究課件
- 人員能力矩陣圖
- 多智能體系統(tǒng)教材課件匯總完整版ppt全套課件最全教學教程整本書電子教案全書教案課件合集
- 購物中心租金修正測算
- 冀教版八年級下冊nit 5 Buying and Selling Lesson 30 A Cookie Sale課件(共13張PPT)
評論
0/150
提交評論