国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

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

分享到微博請遵守國家法律
安乡县| 霍城县| 台江县| 河东区| 北宁市| 乳山市| 上蔡县| 呼玛县| 喀喇沁旗| 宿州市| 家居| 常州市| 涿鹿县| 桃园市| 理塘县| 重庆市| 岳阳县| 青河县| 颍上县| 贵定县| 伊川县| 乐平市| 蛟河市| 周宁县| 锡林浩特市| 塘沽区| 微山县| 永和县| 双辽市| 绥芬河市| 蓬溪县| 晋宁县| 苗栗市| 新宾| 林西县| 鄂托克旗| 绥中县| 澜沧| 连山| 绿春县| 炎陵县|