Swift code
import Foundation
protocol TaksPerformer {
func doAThing()
}
class Employee: TaksPerformer {
let name: String
var boss: Boss?
init(name: String) {
self.name = name
}
func doAThing() {
print("\(name) is doing a thing")
}
}
class Boss {
var employee: Employee
let name: String
init(name: String, employee: Employee) {
self.name = name
self.employee = employee
employee.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.
Swift code



Swift code import Foundation protocol TaksPerformer { func doAThing() } class Employee: TaksPerformer { let name: String...
please look at below code and respond all the required import Foundation protocol TaksPerformer { func doAThing() } class Employee: TaksPerformer { let name: String var boss: Boss? init(name: String) { self.name = name } func doAThing() { print("\(name) is doing a thing") } } class Boss { var employee: Employee let name: String init(name: String, employee: Employee) { self.name = name self.employee = employee employee.boss = self } func actLikeABoss() { employee.doAThing() } } // 1) // A) What...
import Foundation class Customer{ var FirstName: String var LastName: String var Address: String var Address2: String var City: String var State: String var Zip: Int init(){ FirstName = "" LastName = "" Address = "" Address2 = "" City = "" State = "" Zip = 0 } Create a function that will print each of the attributes out to the console. Remember, zip code is an integer, and you will need keep this in mind when you are trying...
Write Java code with JDBC (as discussed in class) to perform the following tasks: EMPLOYEE(Name, Ssn, Address, DeptNo, Age, Salary) DEPARTMENT(Dname, Dnumber, Budget, Mgr_ssn) Establish a logical session with a database you have created for the two relations Use JDBC to submit an SQL query and print the name of each employee with a salary greater than 100,000
1) Given the following Swift function: func requestAccess(for id; String, to resource: Resource) -> Access { // code } What name is used to access the second parameter's value from within the function? to resource to_resource none 2) Given the following Swift code: let schoolName = "University of Missouri" Is the following allowed on a subsequent line in the same scope? schoolName = "Ohio State University" Yes No 3) Choose the correct way to declare a variable for an array...
Using the following code: store.py from abc import ABC,abstractmethod class Store(ABC): #creating a abstract class name='' #declaring attributes in class address='' status='' sales_tax_percentage=0.0 def __init__(self,name,address,status,sales_tax_percentage): #init method to initialize the class attributes self.name=name self.address=address self.status=status self.sales_tax_percentage=sales_tax_percentage def get_name(self): #Getter and setter methods for variables return self.name def set_name(self,name): self.name=name def get_address(self): return self.address def set_address(self,address): self.address=address def set_status(self,status): self.status=status def get_status(self): return self.status def set_sales_tax_percentage(self,sales_tax_percentage): self.sales_tax_percentage=sales_tax_percentage def get_sales_tax_percentage(self): return self.sales_tax_percentage def is_store_open(self): #check store status or availability if self.status=="open": #Return...
//*Manager.java*//
public interface Manager {
public void handleCrisis();
}
_________________________________________________________
/**Employee.java**/
Public abstract class Employee {
protected final String name;
protected final int id;
public Employee(String empName, int empId) {
name = empName;
id = empId;
}
public Employee() {
name = generatedNames[lastGeneratedId];
id = lastGeneratedId++;
}
public String getName() {
return name;
}
public int getId() {
return id;
}
//returns true if work was successful. otherwise returns false (crisis)
public abstract boolean work();
public String toString() {
return...