Computers and Technology
Computers and Technology, 28.06.2019 03:40, Seena912

Assume the existence of an interface, commdevice, with the following methods: transmit: accepts two string parameters and returns nothingreceive: accepts two string parameters and returns a booleandefine a class, firewall, that implements the above interface, and has the following members: a string instance variable, permittedreceivera string instance variable, buffera constructor that accepts a string parameter that is used to initialize the permittedreceiver variablean implementation of the transmit method that assigns the first parameter to the destination instancevariable and the second to the buffer variable. it also send to system. out the message "data scheduledfor transmission to dest" where dest is replaced by the actual value of the destination string. an implementation of the receiver method that checks if the first parameter is equal to the permittedreceiver andif so it sets the buffer instance variable to the second parameter and returns true; otherwise it sets the buffer to the empty string, prints the message"attempted breach of firewall by < receiver> " where < receiver> is replaced by the method's first parameter, and returns false.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 18:30, porkhappycom
Which number on the image above correctly indicates the name of a folder in this url? a.1b.2c.3d.4
Answers: 2
image
Computers and Technology, 22.06.2019 18:00, alexj29227405
Write a method named addall that could be placed inside the hashintset class. this method accepts another hashintset as a parameter and adds all elements from that set into the current set, if they are not already present. for example, if a set s1 contains [1, 2, 3] and another set s2 contains [1, 7, 3, 9], the call of s1.addall(s2); would change s1 to store [1, 2, 3, 7, 9] in some order. you are allowed to call methods on your set and/or the other set. do not modify the set passed in. this method should run in o(n) time where n is the number of elements in the parameter set passed in.
Answers: 2
image
Computers and Technology, 23.06.2019 04:20, milkshakegrande101
4. a1. vince owns a television repair shop that is insured undera commercial package policy. the policy includes thebuilding and personal property coverage form and thecauses-of-loss broad form. the declarations page indicatesthat coverage applies to both the building and the namedinsured's business property. explain whether or not thefollowing losses would be covered under his policy. a. a fire occurs on the premises, and the building isbadly damaged. b. a burglar steals some money and securities from anunlocked safe. c. a business computer is damaged by vandals whobreak into the shop after business hours. d. a tornado touches down near the store. several tel-evision sets of customers in the shop for repair aredamaged in the storm. til
Answers: 2
image
Computers and Technology, 24.06.2019 21:30, keelynnbarrier
Computer security/cybersecurity1) each of the following code fragments contains a number of security vulnerabilities. for each fragment, identify these security vulnerabilities and, for each vulnerability, discuss at least one way that it could be improved. note that in your discussion of how each vulnerability could be improved, you do not need to re-write a new version of the program in c; simply discuss your solution, either in pseudocode or in 1-2 sentences. a) /* file descriptor leak */#include #include int main(int argc, char *argv[]){ char *filepath = argv[0]; char *shellpath = argv[1]; file *passwords; passwords = fopen(filepath, "r"); /* read the password and do something with it */ /* . . */ /* fork and execute alternative shell */ execl(shellpath, "shell", null); }b)#include /* assume the following function is written for an electronic storefront. the user will enter the id of the item to be ordered, as well as the quantity of units that they would like to purchase. the program will then lookup the price for the price for the item using a predefined function, and return the total cost of the order.*/int gettotalcost(){ char itemid[9]; int price, unitsordered, cost; printf(" enter the 9-digit id of the item to be ordered: "); scanf("%s", & itemid); /* lookup the price according to the itemid */ price = getpricebyid(itemid); printf(" enter the quantity of units to be ordered: "); scanf("%d", & unitsordered); cost = price * unitsordered; return cost; }c)#include /* the following function is intended to return a user's full name by concatenating the user's first and last name into a single string and then returning that string. */char *getfullname(char *firstname, char *lastname, int max_len){ char fullname[max_len]; strcpy(fullname, firstname); strcat(fullname, " "); strcat(fullname, lastname); return fullname; }d)#include /* the following code snippet runs through the list of cli arguments entered and displays them to the console. */int main(int argc, char *argv[]){ int i; printf("you've entered the following arguments: "); for(i = 0; i < argc; i++){ print(argv[i]); printf("\n"); } /* */}
Answers: 2
Do you know the correct answer?
Assume the existence of an interface, commdevice, with the following methods: transmit: accepts two...

Questions in other subjects:

Konu
Mathematics, 11.03.2021 02:20
Konu
Mathematics, 11.03.2021 02:30
Konu
Biology, 11.03.2021 02:30
Konu
Mathematics, 11.03.2021 02:30