五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

移動應(yīng)用程序開發(fā)|第八講-協(xié)議和擴展:A Swift Lesson in ...

2023-01-14 07:55 作者:陳鵬宇老師  | 我要投稿

第八次作業(yè)

?
01:19:34
?

注:作業(yè)的PDF版本也可以從視頻簡介提供的網(wǎng)盤鏈接中下載

作業(yè)一:完成下面的練習題

1. Implement the Robot protocols we discussed in class and create structs for the following robots:

  • A robot that has a laser gun, wheels, arms, and is petrol powered.
  • A robot that is petrol powered and has arms.
  • A robot that has a laser gun and is bipedal.
  • A robot that has wheels and antennae.
  • A robot that is petrol powered and has wheels.

Create an instance of each of these robots.

Create a brand new robot feature protocol, and add it to one of your existing robots.


2. Make a loop that iterates through the animals in our Animal array in class, and see if you can figure out how to call either bark or meow, depending on whether the item in the array is a Dog or a Cat.

Once you’ve done that, create a new animal that conforms to the Animal type. Give it a method named after the sound it makes, add it to the Animal array, and make it work with the loop.


3. Consider the following code. It has a few missing bits. Can you figure out what they are? Fill them in and run the code.


4. A Swift program is all scrambled up below. Can you rearrange the code snippets to make a working program that produces the output listed below? The code uses concepts we've discussed in class, as well as a few that we haven't.


5. BE the Swift Compiler

Each of the Swift code snippets on page 6-8 represents a complete Playground. Your job is to play Swift compiler, and determine whether each of these will run or not. If they run, what do they do? If they don’t run, explain why.


作業(yè)二:完成Playgrounds App《繼續(xù)構(gòu)建App》第1~3章


移動應(yīng)用程序開發(fā)|第八講-協(xié)議和擴展:A Swift Lesson in ...的評論 (共 條)

分享到微博請遵守國家法律
白玉县| 平谷区| 通州市| 东安县| 东光县| 鄂伦春自治旗| 定南县| 峨边| 中山市| 汶川县| 贞丰县| 黄平县| 托克逊县| 博白县| 西藏| 景宁| 吕梁市| 武清区| 新沂市| 新乐市| 社旗县| 潢川县| 南部县| 太仆寺旗| 福清市| 黄浦区| 平谷区| 简阳市| 曲水县| 闽清县| 长葛市| 枞阳县| 江阴市| 沙湾县| 钦州市| 丰顺县| 沂水县| 申扎县| 唐河县| 壤塘县| 五家渠市|