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 01:30
How will you cite information that is common knowledge in your research paper?
Answers: 1
question
Computers and Technology, 23.06.2019 02:00
Consider the following function main: int main() { int alpha[20]; int beta[20]; int matrix[10][4]; . . } a. write the definition of the function inputarray that prompts the user to input 20 numbers and stores the numbers into alpha. b. write the definition of the function doublearray that initializes the elements of beta to two times the corresponding elements in alpha. make sure that you prevent the function from modifying the elements of alpha. c. write the definition of the function copyalphabeta that stores alpha into the first five rows of matrix and beta into the last five rows of matrix. make sure that you prevent the function from modifying the elements of alpha and beta. d. write the definition of the function printarray that prints any onedimensional array of type int. print 15 elements per line. e. write a c11 program that tests the function main and the functions discussed in parts a through d. (add additional functions, such as printing a two-dimensional array, as needed.)
Answers: 3
question
Computers and Technology, 23.06.2019 21:20
For positive constants a and b, the force between two atoms in a molecule is given f(r) = −a r2 + b r3 , where r > 0 is the distance between the atoms. note: a and b are upper case letters. (a) find f '(r) = (b) find the critical point for f(r). r = (c) find f ''(r) = (d) find the value of r so that f ''(r) = 0.
Answers: 1
question
Computers and Technology, 24.06.2019 06:30
Ineed to know the anwser to all these questions
Answers: 2
You know the right answer?
Look at below code and respond all the requiredimport foundationprotocol taksperformer {func doathin...
Questions
question
English, 30.11.2020 23:10
question
Mathematics, 30.11.2020 23:10
question
Social Studies, 30.11.2020 23:10
question
Mathematics, 30.11.2020 23:10
question
English, 30.11.2020 23:10
question
Mathematics, 30.11.2020 23:10
Questions on the website: 13722360