无码av一区二区三区无码,在线观看老湿视频福利,日韩经典三级片,成 人色 网 站 欧美大片在线观看

歡迎光臨散文網(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 ...的評論 (共 條)

分享到微博請遵守國家法律
弥勒县| 青田县| 平乐县| 平昌县| 牡丹江市| 大连市| 苏尼特右旗| 阿荣旗| 雅安市| 汝南县| 普格县| 沁水县| 津南区| 沙田区| 玉环县| 彩票| 酒泉市| 南安市| 正安县| 驻马店市| 扎兰屯市| 东海县| 高邑县| 钟祥市| 淮北市| 饶平县| 岚皋县| 永仁县| 拉孜县| 巩留县| 邵东县| 洪洞县| 衢州市| 通山县| 太谷县| 南通市| 重庆市| 汽车| 伊宁县| 河北省| 石阡县|