Computers and Technology

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}

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 16:00, bry7474
A(n) is a small bit of text separated from the rest of the paragraph at the top of a column or page.
Answers: 2
image
Computers and Technology, 22.06.2019 07:30, ghopk5929
In the film "epic 2015," epic is the name for:
Answers: 3
image
Computers and Technology, 22.06.2019 08:00, Leggett8152
What best describes a career pathway in a lodging career? a worker starts out as an amusement attendant, then becomes a recreation worker, and then becomes a gaming worker within five years. a worker starts out as a bell hop, then becomes a night clerk, and then becomes a hotel manager within five years. a worker starting out as a tour guide, then becomes a travel clerk, and then becomes a travel agent within five years. a worker starts out as a server, then becomes a food preparer, and then becomes a head chef within five years.
Answers: 1
image
Computers and Technology, 25.06.2019 06:00, Andy769
Shaniya has misspelled a scientific name in her biology report. she needs to correct it, but she has no access to a computer. she plans to use the word app on her phone without an office 365 subscription. can shaniya correct her mistake? why or why not? yes, she can navigate the window and do simple editing. yes, she can use this application for free and navigate the window. no, her document is β€œread-only,” so she cannot navigate the window. no, her application has limited features and she cannot access the documen
Answers: 1
Do you know the correct answer?
Look at below code and respond all the requiredimport foundationprotocol taksperformer {func doathin...

Questions in other subjects:

Konu
Mathematics, 16.06.2020 19:57
Konu
Spanish, 16.06.2020 19:57