subject

Look at below code and respond all the requiredimport foundationprotocol taksperformer {func doathing()}class employee: taksperformer {let name: stringvar boss: boss? init(name: string) {self. name = name}func doathing() {print("\(name) is doing a thing")}}class boss {var employee: employeelet name: stringinit(name: string, employee: employee) {self. name = nameself. employee = employeeemployee. boss = self}func actlikeaboss() {employee. doathing()}}// 1)// a) what is wrong with the current implementation of boss and employee, why is it wrong, and how can we demonstrate that there is an issue? b) what pattern discussed in class does the boss - employee relationship remind you of? give an example of the discussed pattern. c) create a person class that has the following property: // let name: string// now have employee and boss inherit from person d) you realize that there are speciffic tasks you would like an employee to perform. all tasks look like this: // func makecoffe(_ name: string) {// print("\(name) made coffe")// } func writereport(_ name: string) {// print("\(name) wrote a report")// }// modify boss, employee and taskperformer in a way that a boss can be instantiated with the following constructor: // boss(name: "bossman", employee: anemployee, tasks: [makecoffe, writereport])// the employee instance should perform the tasks.// 2)// create a small app that takes user input and performs a useful calculation with that user input// - using techniques we learned in class, make sure that absolutely no input crashes the app.// - use layout constraints to make sure the app looks good in portraint and landscape mode, as well as on small and large devices.// - use mvc// - bonus: write unit tests for your model to make sure no input can crash the app.// 3) you created a bookshelf.// a) how could you modify shelve with a technique discussed in class so that you can create shelve instances that contain// tools, dishes or any other kind of object? // b) create a function that takes in two shelves of the same type and swaps their itemsstruct book {let title: string}struct shelve {var top: bookvar center: bookvar bottom: book}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
How does a policy manual an organization? a. it boost productivity. b. it create awareness in employees about the organization’s values. c. it employees achieve targets. d. it safeguards the organization from liabilities.
Answers: 1
question
Computers and Technology, 22.06.2019 22:00
Discuss the ways in which electronic information associated with payments is addressed in terms of security. include encryption, secure sockets layers, and secure electronic transactions in your discussion. are there any other ways that consumers and businesses can keep their payment information secure in an electronic commerce environment? do you feel that your information is safe when conducting electronic business? why or why not?
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
Visually impaired individuals generally rely on the for navigation. thus, designers need to ensure that mouse-specific inputs, such as pointing, clicking, and hovering, can be done without a mouse.
Answers: 1
question
Computers and Technology, 23.06.2019 16:00
What is the biggest difference between section breaks and regular page breaks? section breaks are more difficult to add than page breaks. section breaks make it easier for you to view the document as an outline. section breaks allow you to have areas of the document with different formatting. section breaks are smaller than regular page breaks.
Answers: 2
You know the right answer?
Look at below code and respond all the requiredimport foundationprotocol taksperformer {func doathin...
Questions
question
World Languages, 04.12.2020 04:40
question
Mathematics, 04.12.2020 04:40
question
Social Studies, 04.12.2020 04:40
Questions on the website: 13722363