无码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 ...的評論 (共 條)

分享到微博請遵守國家法律
莱阳市| 垦利县| 高台县| 武清区| 大冶市| 来凤县| 洪泽县| 丹寨县| 元氏县| 河南省| 全南县| 甘谷县| 临颍县| 曲水县| 大同县| 沁阳市| 海淀区| 林州市| 义乌市| 隆子县| 化州市| 岳阳市| 马山县| 康定县| 威信县| 南漳县| 晋城| 渭南市| 岳阳市| 钟祥市| 新宁县| 砚山县| 定远县| 无极县| 兰考县| 汤原县| 安丘市| 蓬安县| 巴林右旗| 綦江县| 寿宁县|