五月天青色头像情侣网名,国产亚洲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 ...的評論 (共 條)

分享到微博請遵守國家法律
肃北| 龙游县| 和平县| 五台县| 衡水市| 运城市| 大足县| 平定县| 永福县| 德令哈市| 唐河县| 潜山县| 廉江市| 黄陵县| 郑州市| 丰镇市| 阜南县| 车险| 资溪县| 曲靖市| 灌南县| 桂东县| 金平| 邛崃市| 闽侯县| 德安县| 织金县| 瑞金市| 上林县| 杭锦旗| 孝昌县| 黔西| 卓资县| 吉水县| 洮南市| 峨眉山市| 保德县| 湖北省| 长阳| 大化| 静海县|