Answer:
Following are the answer to this question:
Explanation:
There will be several ways to provide it, although it is simpler to let another front side Will work out a three-way handshake or transfer packages to there with a Server chosen. Its application responds TCP packets with both the destination node of the front end.
The very first packet was sent to a computer as an option. Mention, even so, that perhaps the end of the queue end remains in the loop in this scenario. Rather than obtaining this information from the front end like in the primary healthcare services, you have the advantage of this capability: its selected server helps to generate TCP state.
Assuming a Stop-and-Wait system, if the bandwidth-delay product of a channel is 500 Mbps and 1 bit takes 25 milliseconds to make the roundtrip, what is the bandwidth-delay product? If the data packets are 2500 bits in length, what is the utilization?
Answer:
Bandwidth delay product = 2500 Kbits
Utilization = 0.02%
Explanation:
We proceed as follows;
From the question, we are given that
band width = 500 Mbps
The bandwidth-delay product is = 500 x 10^6 x 25 x 10^-3
= 2500 Kbits
The system can send 12500 Kbits during the time it takes for the data to go from the sender to the receiver and then back again.
However, the system sends only 2500 bits.
The the link utilization =
2500/(12500 x 10^3) = 0.02%
A signal travels from point A to point B. At point A, the signal power is 100 W. At point B, the power is 90 W. What is the attenuation in decibels?
Answer:
[tex]Attenuation = 0.458\ db[/tex]
Explanation:
Given
Power at point A = 100W
Power at point B = 90W
Required
Determine the attenuation in decibels
Attenuation is calculated using the following formula
[tex]Attenuation = 10Log_{10}\frac{P_s}{P_d}[/tex]
Where [tex]P_s = Power\ Inpu[/tex]t and [tex]P_d = Power\ outpu[/tex]t
[tex]P_s = 100W[/tex]
[tex]P_d = 90W[/tex]
Substitute these values in the given formula
[tex]Attenuation = 10Log_{10}\frac{P_s}{P_d}[/tex]
[tex]Attenuation = 10Log_{10}\frac{100}{90}[/tex]
[tex]Attenuation = 10 * 0.04575749056[/tex]
[tex]Attenuation = 0.4575749056[/tex]
[tex]Attenuation = 0.458\ db[/tex] (Approximated)
A security administrator is investigating a report that a user is receiving suspicious emails. The user's machine has an old functioning modem installed. Which of the following security concerns need to be identified and mitigated? (Select TWO).
a) Vishing
b) Whaling
c) Spear phishing
d) Pharming
e) War dialing
f) Hoaxing
Answer:
Spear Phishing and War Dialing
Explanation:
So let's tackle these one at a time.
Vishing is simply any type of message (i.e., email, text, phone call, etc.) that appears to be from a trusted source but is not.
Whaling is simply a spear phishing attack of a high-value target such as a CEO or someone with high-level access at a company.
Spear phishing is simply a targeted phishing attack, usually towards a specific person or group of people. (Phishing attack is simply a social attack to try and gain unauthorized access to a resource).
Pharming is an attack that attempts to redirect website traffic to a fake site.
War dialing is a technique to automatically scan a list of numbers in an area in attempt to search for exposed modems, computers, board systems, or fax machines, in order to breach the network.
Hoaxing is simply a social attack that describes a serious threat in attempts to retrieve unauthorized access or money from a victim. (Think microsoft tech support scams)
Now that we have defined these things, let's identify the possible threats that need to be reported.
(a) Vishing? The sec admin report doesn't mention the source of the message so we cannot associate this one
(b) Whaling? The sec admin report says a user, implying someone not high up in the company, but doesn't say it's not someone high up. This is possible.
(c) Spear phishing? The sec admin report says a user, implying that only this user is being targeted so this is definitely valid.
(d) Pharming? The sec admin report says nothing about site redirection.
(e) War dialing? The sec admin report doesn't say anything about unauthorized scanning; however, it mentions the user has an old functioning modem, so this is possible.
(f) Hoaxing? The sec admin report doesn't mention a pop up in the email or the content of the email so we are uncertain.
Thus with these considerations, the two threats that are identified and need mitigation are Spear phishing and War Dialing/Whaling. Note that we aren't positive of the war dialing or whaling, but a case could be made for either; however, given the modem information, the question seems to indicate war dialing.
Consider these functions:_________.
def f(x) :
return g(x) + math.sqrt(h(x))
def g(x):
return 4 h(x)
def h(x):
return x x + k(x)-1
def k(x):
return 2 (x + 1)
Without actually compiling and running a program, determine the results of the following function calls.
a. x1 = f(2)
b. x2 = g(h(2)
c. x3 = k(g(2) + h(2))
d. x4 - f(0) + f(l) + f(2)
e. x5 - f{-l) + g(-l) + h(-1) + k(-l)
Answer:
x1 = 39
x2 = 400
x3 = 92
x4 = 62
x5 = 0
Explanation:
a. x1 = f(2)This statement calls the f() function passing 2 to the function. The f(x) function takes a number x as parameter and returns the following:
g(x) + math.sqrt(h(x))
This again calls function g() and h()
The above statement calls g() passing x i.e. 2 to the function g(x) and calls function h() passing x i.e. 2 to h() and the result is computed by adding the value returned by g() to the square root of the value returned by the h() method.
The g(x) function takes a number x as parameter and returns the following:
return 4*h(x)
The above statement calls function h() by passing value 2 to h() and the result is computed by multiplying 4 with the value returned by h().
The h(x) function takes a number x as parameter and returns the following:
return x*x + k(x)-1
The above statement calls function k() by passing value 2 to k() and the result is computed by subtracting 1 from the value returned by k() and adding the result of x*x (2*2) to this.
The k(x) function takes a number x as parameter and returns the following:
return 2 * (x + 1)
As the value of x=2 So
2*(2+1) = 2*(3) = 6
So the value returned by k(x) is 6
Now lets go back to the function h(x)
return x*x + k(x)-1
x = 2
k(x) = 6
So
x*x + k(x)-1 = 2*2 + (6-1) = 4 + 5 = 9
Now lets go back to the function g(x)
return 4*h(x)
As x = 2
h(x) = 9
So
4*h(x) = 4*9 = 36
Now lets go back to function f(x)
return g(x) + math.sqrt(h(x))
As x=2
g(x) = 36
h(x) = 9
g(x) + math.sqrt(h(x)) = 36 + math.sqrt(9)
= 36 + 3 = 39
Hence
x1 = 39b. x2 = g(h(2) )The above statement means that first the function g() calls function h() and function h() is passed a value i.e 2.
As x=2
The function k() returns:
2 * (x + 1) = 2 * (2 + 1) = 6
The function h() returns:
x*x + k(x)-1 = 2*2 + (6-1) = 4 + 5 = 9
Now The function g() returns:
4 * h(x) = 4 * h(9)
This method again calls h() and function h() calls k(). The function k() returns:
2 * (x + 1) = 2 * (9 + 1) = 20
Now The function h() returns:
x*x + k(x)-1 = 9*9 + (20-1) = 81 + 19 = 100
h(9) = 100
Now The function g() returns:
4 * h(x) = 4 * h(9) = 4 * 100 = 400
Hence
x2 = 400c. x3 = k(g(2) + h(2))g() returns:
return 4 h(x)
h() returns:
return x*x + k(x)-1
k(2) returns:
return 2 (x + 1)
= 2 ( 3 ) = 6
Now going back to h(2)
x * x + k(x)-1 = 2*2 + 6 - 1 = 9
Now going back to g(2)
4 h(x) = 4 * 9 = 36
So k(g(2) + h(2)) becomes:
k(9 + 36 )
k(45)
Now going to k():
return 2 (x + 1)
2 (x + 1) = 2(45 + 1)
= 2(46)
= 92
So k(g(2) + h(2)) = 92
Hence
x3 = 92d. x4 = f(0) + f(1) + f(2)Compute f(0)
f() returns:
return g(0) + math.sqrt(h(0))
f() calls g() and h()
g() returns:
return 4 * h(0)
g() calls h()
h() returns
return 0*0 + k(0)-1
h() calls k()
k() returns:
return 2 * (0 + 1)
2 * (0 + 1) = 2
Going back to caller function h()
Compute h(0)
0*0 + k(0)-1 = 2 - 1 = 1
Going back to caller function g()
Compute g(0)
4 * h(0) = 4 * 1 = 4
Going back to caller function f()
compute f(0)
g(0) + math.sqrt(h(0)) = 4 + 1 = 5
f(0) = 5
Compute f(1)
f() returns:
return g(1) + math.sqrt(h(1))
f() calls g() and h()
g() returns:
return 4 * h(1)
g() calls h()
h() returns
return 1*1 + k(1)-1
h() calls k()
k() returns:
return 2 * (1 + 1)
2 * (1 + 1) = 4
Going back to caller function h()
Compute h(0)
1*1 + k(1)-1 = 1 + 4 - 1 = 4
Going back to caller function g()
Compute g(1)
4 * h(1) = 4 * 4 = 16
Going back to caller function f()
compute f(1)
g(1) + math.sqrt(h(1)) = 16 + 2 = 18
f(1) = 18
Compute f(2)
f() returns:
return g(2) + math.sqrt(h(2))
f() calls g() and h()
g() returns:
return 4 * h(2)
g() calls h()
h() returns
return 1*1 + k(2)-1
h() calls k()
k() returns:
return 2 * (2+1)
2 * (3) = 6
Going back to caller function h()
Compute h(2)
2*2 + k(2)-1 = 4 + 6 - 1 = 9
Going back to caller function g()
Compute g(2)
4 * h(2) = 4 * 9 = 36
Going back to caller function f()
compute f(2)
g(2) + math.sqrt(h(2)) = 36 +3 = 39
f(1) = 13.7
Now
x4 = f(0) + f(l) + f(2)
= 5 + 18 + 39
= 62
Hence
x4 = 62e. x5 = f(-1) + g(-1) + h(-1) + k(-1)Compute f(-1)
f() returns:
return g(-1) + math.sqrt(h(-1))
f() calls g() and h()
g() returns:
return 4 * h(-1)
g() calls h()
h() returns
return 1*1 + k(-1)-1
h() calls k()
k() returns:
return 2 * (-1+1)
2 * (0) = 0
Going back to caller function h()
Compute h(-1)
-1*-1 + k(-1)-1 = 1 + 0 - 1 = 0
Going back to caller function g()
Compute g(-1)
4 * h(-1) = 4 * 0 = 0
Going back to caller function f()
compute f(-1)
g(-1) + math.sqrt(h(-1)) = 0
f(-1) = 0
Compute g(-1)
g() returns:
return 4 * h(-1)
g() calls h()
h() returns
return 1*1 + k(-1)-1
h() calls k()
k() returns:
return 2 * (-1+1)
2 * (0) = 0
Going back to caller function h()
Compute h(-1)
-1*-1 + k(-1)-1 = 1 + 0 - 1 = 0
Going back to caller function g()
Compute g(-1)
4 * h(-1) = 4 * 0 = 0
g(-1) = 0
Compute h(-1)
h() returns
return 1*1 + k(-1)-1
h() calls k()
k() returns:
return 2 * (-1+1)
2 * (0) = 0
Going back to caller function h()
Compute h(-1)
-1*-1 + k(-1)-1 = 1 + 0 - 1 = 0
h(-1) = 0
Compute k(-1)
k() returns:
return 2 (x + 1)
k(-1) = 2 ( -1 + 1 ) = 2 ( 0 ) = 0
k(-1) = 0
x5 = f(-1) + g(-1) + h(-1) + k(-1)
= 0 + 0 + 0 + 0
= 0
Hence
x5 = 0The dramatic growth in the number of power data centers, cell towers, base stations, recharge mobiles, and so on is damaging the environment because Radio Frequency Interference (RFI) is overcrowding specific areas of the electromagnetic spectrum.
A. True
B. False
Answer:
A. True
Explanation:
Radio frequency interference abbreviated RFI is radio interference that occurs as a result of radiation in radio frequency energy that usually causes electronic devices to malfunction. Radio frequency interference or RFI is given out or emitted by electrical devices or centres such as mobile phones, satellites or data centres which affects the environment by increasing heat and bringing about increased body temperature in humans
Some network applications defer configuration until a service is needed. For example, a computer can wait until a user attempts to print a document before the software searches for available printers.
What is the chief advantage of deferred configuration?
Answer:
The drivers wont be loaded and the deamons will not be running in the background unnecessarily, that makes the processes to run more faster
Explanation:
The chief advantage of deferred configuration or the advantage when some network applications defer configuration until a service is needed is that the drivers won't be loaded and the deamons will not be running in the background unnecessarily or when idle, that makes the processes to run more faster.
Network configuration is the activity which involves setting up a network's controls, flow and operation to assist the network communication of an organization or network owner.
nside of your organization that checks how often client machines access it. If a client machine hasn't accessed the server in three months, the server won't allow the client machine to access its resources anymore. What can you set to make sure that your client machines and the server times are in sync
Complete Question:
Let's say that you handle the IT systems administration for your company. There's a server inside of your organization that checks how often client machines access it. If a client machine hasn't accessed the server in three months, the server won't allow the client machine to access its resources anymore. What can you set to make sure that your client machines and the server times are in sync?
Answer:
Network Time Protocol (NTP).
Explanation:
As the IT systems administrator, you can set the network time protocol (NTP) to make sure that your client machines and the server times are in synchronization.
A network time protocol (NTP) can be defined as an internet standard protocol which is used by an IT system administrator to synchronize a computer's clock to a particular time reference over packet switched or local area network (LAN) and variable-latency data networks. NTP was developed at the University of Delaware by Professor David L. Mills.
Basically, the network time protocol uses the coordinated universal time (UTC) and a client-server model to measure the total round-trip delay for a computer process.
An algorithm that could execute for an unknown amount of time because it depends on random numbers to exit a function may:_______
a. have a redundancy.
b. get caught in an infinite loop.
c. suffer from indefinite postponement.
d. issue a compiler error.
Answer:
c. suffer from indefinite postponement.
Explanation:
Algorithm is a set of rules that are followed in calculations or other problem solving operation by a computer. An algorithm may execute for unknown amount of time and it may suffer indefinite postponement. Algorithm depends on random numbers and it can execute continuously.
Lily is in her first year of undergraduate coursework and has not yet declared a major. She has attended a lot of career fairs and undergraduate major "open house" events to investigate her options. Marcia's theory of identity status suggests that the dimension Lily is most concerned with is the_____of 1 dimension.
Answer:
exploration
Explanation:
According to Marcia's theory of identity, the status suggests that the dimension Lily is most concerned with is the exploration dimension.
James E. Marcia who came up with the Marcia's theory of identity is a clinical and developmental psychologist. He also once taught at Simon Fraser University which is located in British Columbia, Canada and also in the State University of New York at Buffalo in Upstate, New York City.
James E. Marcia is also very much involved in clinical private practice, community consultation, clinical psychology supervision, and also in international clinical-developmental research and teaching.
A printer is connected locally on Computer1 and is shared on the network. Computer2 installs the shared printer and connects to it. Computer1 considers the printer to be a(n) ________________ printer, and Computer2 considers the printer to be a(n) ________________ printer.
Answer:
A printer is connected locally on Computer1 and is shared on the network. Computer2 installs the shared printer and connects to it. Computer1 considers the printer to be a(n) _____local___________ printer, and Computer2 considers the printer to be a(n) _____network___________ printer.
Explanation:
Any printer installed directly to Computer 1 is a local printer. If this printer is then shared with computers 2 and 3 in a particular networked environment, it becomes a shared printer. For these other computers 2 and 3, the shared printer is a network printer, because it is not locally installed in each of them. There may be some features which network computers cannot use on a shared printer, especially if the printer can scan documents.
If the current date is Monday, February 26, 2017, what will be displayed by the alert dialog box after the following code executes? var thisDay = new Date(); alert(thisDay.toDateString());
Answer:
Mon Feb 26 2017
Explanation:
Since the current date is considered as Monday, February 26, 2017, thisDay will be set to that value.
The toDateString() method returns the first three letters of the name of the day (The first letter is capitalized), the first three letters of the name of the month (The first letter is capitalized), the day of the month as an integer, and the year as an integer (There are spaces between all)
Why is a DNS cache poisoning attack dangerous? Check all that apply. A. Errrr...it's not actually dangerous. B. It allows an attacker to redirect targets to malicious webservers. C. It allows an attacker to remotely controle your computer. D. It affects any clients querying the poisoned DNS server.
Answer:
(B) It allows an attacker to redirect targets to malicious webserver.
(D) It affects any clients querying the poisoned DNS server.
Explanation:
DNS cache poisoning is a serious type of attack that is designed to exploit the vulnerabilities inherent in a Domain Name Server (DNS) where a user is redirected from a real server to a fake one. It is also called DNS spoofing.
Normally, when your browser tries to visits a website through a given domain name, it goes through the DNS server. A DNS server maintains a list of domain names and their equivalent Internet Protocol addresses. This server (DNS) then responds to the request with one or more IP addresses for the browser to reach the website through the domain name.
The computer browser then get to the intended website through the IP address.
Now, if the DNS cache is poisoned, then it has a wrong entry for IP addresses. This might be via hacking or a physical access to the DNS server to modify the stored information on it. Therefore, rather than responding with the real IP address, the DNS replies with a wrong IP address which then redirects the user to an unreal website.
Although they might not be able to control your computer remotely as long as you are not trying to visit a web page via the poisoned information, there are other dangers attached to this type of attack.
Once the DNS server has been poisoned, any client trying to query the server will also be affected since there is no direct way of knowing if the information received from the server is actually correct.
Do Exercise 6.4 from your textbook using recursion and the is_divisible function from Section 6.4. Your program may assume that both arguments to is_power are positive integers. Note that the only positive integer that is a power of "1" is "1" itself. After writing your is_power function, include the following test cases in your script to exercise the function and print the results: print("is_power(10, 2) returns: ", is_power(10, 2)) print("is_power(27, 3) returns: ", is_power(27, 3)) print("is_power(1, 1) returns: ", is_power(1, 1)) print("is_power(10, 1) returns: ", is_power(10, 1)) print("is_power(3, 3) returns: ", is_power(3, 3))
Answer:
Here is the python method:
def is_power(n1, n2): # function that takes two positive integers n1 and n2 as arguments
if(not n1>0 and not n2>0): #if n1 and n2 are not positive integers
print("The number is not a positive integer so:") # print this message if n1 and n2 are negative
return None # returns none when value of n1 and n2 is negative.
elif n1 == n2: #first base case: if both the numbers are equal
return True #returns True if n1=n2
elif n2==1: #second base case: if the value of n2 is equal to 1
return False #returns False if n2==1
else: #recursive step
return is_divisible(n1, n2) and is_power(n1/n2, n2) #call divisible method and is_power method recursively to determine if the number is the power of another
Explanation:
Here is the complete program.
def is_divisible(a, b):
if a % b == 0:
return True
else:
return False
def is_power(n1, n2):
if(not n1>0 and not n2>0):
print("The number is not a positive integer so:")
return None
elif n1 == n2:
return True
elif n2==1:
return False
else:
return is_divisible(n1, n2) and is_power(n1/n2, n2)
print("is_power(10, 2) returns: ", is_power(10, 2))
print("is_power(27, 3) returns: ", is_power(27, 3))
print("is_power(1, 1) returns: ", is_power(1, 1))
print("is_power(10, 1) returns: ", is_power(10, 1))
print("is_power(3, 3) returns: ", is_power(3, 3))
print("is_power(-10, -1) returns: ", is_power(-10, -1))
The first method is is_divisible method that takes two numbers a and b as arguments. It checks whether a number a is completely divisible by number b. The % modulo operator is used to find the remainder of the division. If the remainder of the division is 0 it means that the number a is completely divisible by b otherwise it is not completely divisible. The method returns True if the result of a%b is 0 otherwise returns False.
The second method is is_power() that takes two numbers n1 and n2 as arguments. The if(not n1>0 and not n2>0) if statement checks if these numbers i.e. n1 and n2 are positive or not. If these numbers are not positive then the program prints the message: The number is not a positive integer so. After displaying this message the program returns None instead of True of False because of negative values of n1 and n2.
If the values of n1 and n2 are positive integers then the program checks its first base case: n1 == n2. Suppose the value of n1 = 1 and n2 =1 Then n1 is a power of n2 if both of them are equal. So this returns True if both n1 and n2 are equal.
Now the program checks its second base case n2 == 1. Lets say n1 is 10 and n2 is 1 Then the function returns False because there is no positive integer that is the power of 1 except 1 itself.
Now the recursive case return is_divisible(n1, n2) and is_power(n1/n2, n2) calls is_divisible() method and is_power method is called recursively in this statement. For example if n1 is 27 and n2 is 3 then this statement:
is_divisible(n1, n2) returns True because 27 is completely divisible by 3 i.e. 27 % 3 = 0
is_power(n1/n2,n2) is called. This method will be called recursively until the base condition is reached. You can see it has two arguments n1/n2 and n2. n1/n2 = 27/3 = 9 So this becomes is_power(9,3)
The base cases are checked. Now this else statement is again executed return is_divisible(n1, n2) and is_power(n1/n2, n2) as none of the above base cases is evaluated to true. when is_divisible() returns True as 9 is completely divisible by 3 i.e. 9%3 =0 and is_power returns (9/3,3) which is (3,3). So this becomes is_power(3,3)
Now as value of n1 becomes 3 and value of n2 becomes 3. So the first base case elif n1 == n2: condition now evaluates to true as 3=3. So it returns True. Hence the result of this statement print("is_power(10, 2) returns: ", is_power(10, 2)) is:
is_power(27, 3) returns: True
Following are the program to the given question:
Program Explanation:
Defining a method "is_divisible" that takes two variable "a,b" inside the parameter.Usinge the return keyword that modulas parameter value and checks its value equal to 0, and return its value.In the next step, another method "is_power" is declared that takes two parameter "a,b".Inside the method, a conditional statement is declared, in which three if block is used. Inside the two if block it checks "a, b" value that is "odd number" and return bool value that is "True, False".In the last, if block is used checks "is_power" method value, and use multiple print method to call and prints its value.Program:
def is_divisible(a, b):#defining a method is_divisible that takes two parameters
return a % b == 0#using return keyword that modulas parameter value and checks its value equal to 0
def is_power(a, b):#defining a method is_power that takes two parameters
if a == 1:#defining if block that checks a value equal to 1 or check odd number condition
return True#return value True
if b == 1:#defining if block that checks b value equal to 1 or check odd number condition
return False#return value False
if not is_divisible(a, b):#defining if block that check method is_divisible value
return False##return value False
return is_power(a/b, b)#using return keyword calls and return is_power method
print("is_power(10, 2) returns: ", is_power(10, 2))#using print method that calls is_power which accepts two parameter
print("is_power(27, 3) returns: ", is_power(27, 3))#using print method that calls is_power which accepts two parameter
print("is_power(1, 1) returns: ", is_power(1, 1))#using print method that calls is_power which accepts two parameter
print("is_power(10, 1) returns: ", is_power(10, 1))#using print method that calls is_power which accepts two parameter
print("is_power(3, 3) returns: ", is_power(3, 3))#using print method that calls is_power which accepts two parameter
Output:
Please find the attached file.
Learn more:
brainly.com/question/24432065
A large population of ALOHA users manages to generate 50 requests/sec, including both originals and retransmissions. Time is slotted in units of 40 msec.
Required:
a. What is the chance of success on the first attempt?
b. What is the probability of exactly k collisions and then a success?
c. What is the expected number of transmission attempts needed?
Answer:
The answer is below
Explanation:
Given that:
Frame transmission time (X) = 40 ms
Requests = 50 requests/sec, Therefore the arrival rate for frame (G) = 50 request * 40 ms = 2 request
a) Probability that there is success on the first attempt = [tex]e^{-G}G^k[/tex] but k = 0, therefore Probability that there is success on the first attempt = [tex]e^{-G}=e^{-2}=0.135[/tex]
b) probability of exactly k collisions and then a success = P(collisions in k attempts) × P(success in k+1 attempt)
P(collisions in k attempts) = [1-Probability that there is success on the first attempt]^k = [tex][1-e^{-G}]^k=[1-0.135]^k=0.865^k[/tex]
P(success in k+1 attempt) = [tex]e^{-G}=e^{-2}=0.135[/tex]
Probability of exactly k collisions and then a success = [tex]0.865^k0.135[/tex]
c) Expected number of transmission attempts needed = probability of success in k transmission = [tex]e^{G}=e^{2}=7.389[/tex]
C create a class called Plane, to implement the functionality of the Airline Reservation System. Write an application that uses the Plane class and test its functionality. Write a method called Check In() as part of the Plane class to handle the check in process Prompts the user to enter 1 to select First Class Seat (Choice: 1) Prompts the user to enter 2 to select Economy Seat (Choice: 2) Assume there are only 5-seats for each First Class and Economy When all the seats are taken, display no more seats available for you selection Otherwise it displays the seat that was selected. Repeat until seats are filled in both sections Selections can be made from each class at any time.
Answer:
Here is the C++ program:
#include <iostream> //for using input output functions
using namespace std; //to identify objects like cin cout
class Plane{ //class Plane
private: // declare private data members i.e. first_class and eco_class
int first_class; //variable for first class
int eco_class; //variable declared for economy class
public: // public access modifier
Plane(){ //constructor to initialize values of first_class and eco_class
first_class=0; //initialized to 0
eco_class=0;} //initialized to 0
int getFirst(){ // class method to get data member first_class
return first_class;} //returns the no of reserved first class seats
int getEco(){ // class method to get data member eco_class
return eco_class;} //returns the no of reserved eco class seats
void CheckIn(){ //method to handle the check in process
int choice; //choice between first and economy class
cout<<"\nEnter 1 to select First Class Seat: "<<endl; //prompts user to enter 1 to reserve first class seat
cout<<"\nEnter 2 to select Economy Class Seat: "<<endl; //prompts user to enter 2 to reserve economy class seat
cin>>choice; //reads the choice from user
switch(choice){ // switch statement is used to handle the check in process
case 1: //to handle the first class seat reservation
if(getFirst()<5){ //if the seat is available and the seat limit has not exceed 5
first_class++; //add 1 to the first_class seat to count that a seat is reserved
cout<<"You reserved First class seat! ";} //display the message about successful seat reservation in first class
cout<<"\nNumber of first class seats reserved: "<<getFirst()<<endl;} //displays the number of seats already reserved
else{ //if all first class seats are reserved then display the following message
cout<<"No more seats available for you selection!"<<endl;
if(getEco()>=5 && getFirst()>=5){ //if all seats from first class and economy class are reserved display the following message
cout<<"All seats are reserved!"<<endl;
exit(1);}} //program exits
break;
case 2: //to handle the economy seat reservation
if(getEco()<5){ //if the seat is available and the seat limit has not exceed 5
eco_class++; //add 1 to the eco_class seat to count that a seat is reserved
cout<<"You reserved Economy class seat! "; //display the message about successful seat reservation in economy class
cout<<"\nNumber of Economy class seats reserved: "<<getEco()<<endl;} //displays the number of seats already reserved
else{ //if all economy class seats are reserved then display the following message
cout<<"No more seats available for you selection!"<<endl;
if(getEco()>=5 && getFirst()>=5){ //if all seats from first class and economy class are reserved display the following message
cout<<"All seats are reserved!"<<endl;
exit(1);}} //program exits
break;
default: cout<<"Enter a valid choice"<<endl; } } }; //if user enters anything other that 1 or 2 for choice then this message is displayed
int main(){ //start of main() function body
int select; // choice from first or economy class
Plane plane; //create an object of Plane class
cout<<"**************************"<<endl;
cout<<"Airline Reservation System"<<endl; //display this welcome message
cout<<"**************************"<<endl;
while(true){ // while loop executes the check in procedure
plane.CheckIn();} } //class CheckIn method of Plane classs using plane object to start with the check in process
Explanation:
The program is elaborated in the comments with each statement of the above code. The program has a class Plane that has a method CheckIn to handle the check in process. The user is prompted to enter a choice i.e. enter 1 to select First Class Seat and enter 2 to select Economy Seat. A switch statement is used to handle this process. If user enters 1 then the case 1 of switch statement executes which reserves a seat for the user in first class. If user enters 2 then the case 2 of switch statement executes which reserves a seat for the user in economy class.There are only 5 seats for each First Class and Economy. So when the limit of the seats reservation exceeds 5 then the no more seats available for you selection is displayed. If all the seats are taken in both the first and economy class then it displays the message All seats are reserved. If the user enters anything other than 1 or 2 then display the message Enter a valid choice. Whenever the user reserves one of first or economy class seats the relevant seat is incremented to 1 in order to count the number of seats being reserved. The program and its output are attached.
Description:
Create a program that converts the number of miles that you walked on a hike to the number of feet that you walked.
Console:
Hike Calculator
How many miles did you walk?: 4.5
You walked 23760 feet.
Continue? (y/n): y
How many miles did you walk?: 2.5
You walked 13200 feet.
Continue? (y/n): n
Bye!
Specifications:
The program should accept a float value for the number of miles.
Store the code that gets user input and displays output in the main function.
There are 5280 feet in a mile.
Store the code that converts miles to feet in a separate function. This function should return an int value for the number of feet.
Assume that the user will enter a valid number of miles.
Answer:
The programming language is not stated (I'll answer using C++)
#include <iostream>
using namespace std;
int convert(float miles)
{
return miles * 5280;
}
int main() {
cout<<"Console:"<<endl;
cout<<"Hike Calculator"<<endl;
float miles;
char response;
cout<<"How many miles did you walk?. ";
cin>>miles;
cout<<"You walked "<<convert(miles)<<" feet"<<endl;
cout<<"Continue? (y/n): ";
cin>>response;
while(response == 'y')
{
cout<<"How many miles did you walk?. ";
cin>>miles;
cout<<"You walked "<<convert(miles)<<" feet"<<endl;
cout<<"Continue? (y/n): ";
cin>>response;
}
cout<<"Bye!";
return 0;
}
Explanation:
Here, I'll explain some difficult lines (one after the other)
The italicized represents the function that returns the number of feet
int convert(float miles)
{
return miles * 5280;
}
The main method starts here
int main() {
The next two lines gives an info about the program
cout<<"Console:"<<endl;
cout<<"Hike Calculator"<<endl;
float miles;
char response;
This line prompts user for number of miles
cout<<"How many miles did you walk?. ";
cin>>miles;
This line calls the function that converts miles to feet and prints the feet equivalent of miles
cout<<"You walked "<<convert(miles)<<" feet"<<endl;
This line prompts user for another conversion
cout<<"Continue? (y/n): ";
cin>>response;
This is an iteration that repeats its execution as long as user continue input y as response
while(response == 'y')
{
cout<<"How many miles did you walk?. ";
cin>>miles;
cout<<"You walked "<<convert(miles)<<" feet"<<endl;
cout<<"Continue? (y/n): ";
cin>>response;
}
cout<<"Bye!";
Write a C function check(x, y, n) that returns 1 if both x and y fall between 0 and n-1 inclusive. The function should return 0 otherwise. Assume that x, y and n are all of type int.
Answer:
See comments for line by line explanation (Lines that begins with // are comments)
The function written in C, is as follows:
//The function starts here
int check(x,y,n)
{
//This if condition checks if x and y are within range of 0 to n - 1
if((x>=0 && x<=n-1) && (y>=0 && y<=n-1))
{
//If the if conditional statement is true, the function returns 1
return 1;
}
else
{
//If the if conditional statement is false, the function returns 0
return 0;
}
//The if condition ends here
}
//The function ends here
Explanation:
Type the correct answer in the box.
Who is responsible for creating and testing the incident response plan?
The _______ is responsible for creating and testing the incident response plan.
Answer: CSIRT
Explanation: CSIRT is team that specializes in day to day cyber incidents
The CSIRT is responsible for creating and testing the incident response plan.
What is CSIRT?CSIRT is the Computer emergency response team. One of the key areas for the efficient operation of a corporation is the legal department. Professionals face enormous challenges, particularly when you take into account the need for other bodies within the company itself.
We can list the reviews of the CSIRT procedures that are conducted through this department as one of its key responsibilities. This department also has the responsibility of comprehending the actions that the CSIRT will take to ensure that they comply with all applicable federal, state, and local laws and regulations.
Therefore, the incident response strategy must be written and tested by the CSIRT.
To learn more about CSIRT, refer to the link:
https://brainly.com/question/18493737
#SPJ2
For the Python program below, will there be any output, and will the program terminate?
while True: while 1 > 0: break print("Got it!") break
a. Yes and no
b. No and no
c. Yes and yes
d. No and yes
e. Run-time error
When you use Word's Email option to share a document, you should edit the _____ line to let the recipient know the email is from a legitimate source.
Answer:
Subject line
Explanation:
Editing the subject line is very important so as to enable the recipient know the source of received the message (document).
For example, if a remote team working on a project called Project X receives a shared document by one member of team, we would expect the subject line of the email to be– Project X document. By so doing the legitimacy of the email is easily verified.
The new_directory function
Answer:The new directory method creates a new directory within the current working directory.
Explanation:The new directory function and returns the list of the files within that directory.The new directory function allow to with the built in function MK dir().
To the new directory function create a current working directory.
import OS
OS.MKdir()
The code creates the directory projects in the current working directory to specify the full path.
How I to turn this ''loop while'' in ''loop for''?
var i = 0;
while (i < 20) {
var lineY = 20 + (i * 20);
line(0, lineY, 400, lineY);
i++;
}
Answer:
for (var i = 0; i <20; i++)
{
var lineY = 20 + (i * 20);
line(0, lineY, 400, lineY);
}
Explanation:
To turn the loop while to for loop, you start by considering the iterating variable i and its iterating operations which are;
var i = 0; while (i < 20) and i++;
Where var i = 0; is the initializing statement
(i < 20) is the conditional statement
i++ is the increment
The next is to combine these operations to a for loop; using the following syntax: for(initializing; condition; increment){}
This gives: for(var i = 0; i<20; i++)
Hence, the full code snippet is:
for (var i = 0; i <20; i++)
{
var lineY = 20 + (i * 20);
line(0, lineY, 400, lineY);
}
When Windows deletes the driver package and driver files, in what situation might it not delete driver files used by the device that is being uninstalled?
Answer:
when there is no junk
Explanation:
If you choose the checkbox next to “Delete the driver software from this device,” your computer will no longer contain the driver or any associated registry keys. Either method will prevent you from using the device until you reinstall the device driver.
What is situation deletes driver files used by the device?To connect and communicate with particular devices, a computer needs device drivers.
It may be taken out without any trouble. However, it also comes with the installers for your PC's drivers. You will need to go to the manufacturer's website to download them again if you accidentally delete them.
Therefore, No, unless your new driver is broken and corrupts data. Install the driver if it comes from a reliable source. It is not intended to. Having a backup system that keeps your data safe in case of issues is a good idea.
Learn more about driver files here:
https://brainly.com/question/10608750
#SPJ5
why does study state that unless you were sleeping it is almost impossible not to be communicating?
Answer:
Because your movements, expressions, and posture are also a type of communication
Explanation:
Velma is graduating from Ashford at the end of next year. After she completes her final class, she will reward herself for her hard work with a week-long vacation in Hawaii. But she wants to begin saving money for her trip now. Which of the following is the most effective way for Velma to save money each month?
This question is incomplete because the options are missing; here are the options for this question:
Which of the following is the most effective way for Velma to save money each month?
A. Automatically reroute a portion of her paycheck to her savings account.
B. Manually deposit 10% of her paycheck in her savings account.
C. Pay all of her bills and then place the remaining money in her savings account.
D. Pay all of her bills and then place the remaining money in her piggy bank.
The correct answer to this question is A. Automatically reroute a portion of her paycheck to her savings account.
Explanation:
In this case, Velma needs to consistently save money for her vacation as this guarantees she will have the money for the trip. This means it is ideal every month she contributes consistently to her savings for the vacation.
This can be better be achieved by automatically rerouting a part of her paycheck for this purpose (Option A) because in this way, every month the money for the vacations will increase and the amount of money will be consistent, which means Velma will know beforehand the money she will have for the vacation. Moreover, options such as using a piggy bank or paying the bills and using the rest for her savings, do not guarantee she will contribute to the savings every month, or she will have the money she needs at the end.
A bit shift is a procedure whereby the bits in a bit string are moved to the left or to the right.
For example, we can shift the bits in the string 1011 two places to the left to produce the string 1110. Note that the leftmost two bits are wrapped around to the right side of the string in this operation.
Define two scripts, shiftLeft.py and shiftRight.py, that expect a bit string as an input.
The script shiftLeft shifts the bits in its input one place to the left, wrapping the leftmost bit to the rightmost position.
The script shiftRight performs the inverse operation.
Each script prints the resulting string.
An example of shiftLeft.py input and output is shown below:
Enter a string of bits: Hello world!
ello world!H
An example of shiftRight.py input and output is shown below:
Enter a string of bits: Hello world!
!Hello world
Answer:
Following are the code to this question:
Defining method shiftLeft:
def shiftLeft(bit_string): #defining method shiftLeft, that accepts parameter bit_string
bit_string= bit_string[1:]+bit_string[0]#use bit_string to provide slicing
return bit_string#return bit_string value
bit_string =input("Enter value: ")#defining bit_string variable for user input
print (shiftLeft(bit_string))#use print method to call shiftLeft method
Defining method shiftRight:
def shiftRight(bit_string):#defining method shiftRight, which accepts bit_string variable
bit_string=bit_string[len(bit_string)-1]+bit_string[0:len(bit_string)-1]#using bit_string variable for slicing
return bit_string#return bit_string calculated value
bit_string= input("Enter value: ")#defining bit_string variable for user input
print(shiftRight(bit_string))#use print method to call shiftLeft method
Output:
Please find the attachment.
Explanation:
method description:
In the above-given python code two methods "shiftLeft and shiftRight" are declared, in which both the method accepts a string variable "bit_string". Inside methods, we use the slicing, in which it provides to use all the sequence values and calculated the value in this variable and return its value. At the last step, the bit_string variable is used to input value from the user end and call the method to print its value.Boolean expressions control _________________ Select one: a. recursion b. conditional execution c. alternative execution d. all of the above
Answer:
Option D, all of the above, is the right answer.
Explanation:
A Boolean expression is an expression in Computer Science. It is employed in programming languages that create a Boolean value when it is evaluated. There may be a true or false Boolean value. These expressions correspond to propositional formularies in logic. In Boolean expression, the expression 3 > 5 is evaluated as false while 5 > 3 is evaluated as true
Boolean expressions control all of the above method execution and as such option d is correct.
What is Boolean expressions?A Boolean expression is known to be a kind of logical statement that is said to be one of the two options that is it can be TRUE or FALSE .
Conclusively, Note that Boolean expressions are used to compare two or more data of any type only if both parts of the expression have equal basic data type. Boolean expressions control recursion, conditional execution and alternative execution.
Learn ore about Boolean expressions from
https://brainly.com/question/25039269
Write a function wordcount() that takes the name of a text file as input and prints the number of occurrences of every word in the file. You function should be case-insensitive so 'Hello' and 'hello' are treated as the same word. You should ignore words of length 2 or less. Also, be sure to remove punctuation and digits.
>>>wordcount('frankenstein.txt')
artifice 1
resting 2
compact 1
service 3
Answer:
I am writing a Python program. Let me know if you want the program in some other programming language.
import string #to use string related functions
def wordcount(filename): # function that takes a text file name as parameter and returns the number of occurrences of every word in file
file = open(filename, "r") # open the file in read mode
wc = dict() # creates a dictionary
for sentence in file: # loop through each line of the file
sentence = sentence.strip() #returns the text, removing empty spaces
sentence=sentence.lower() #converts each line to lowercase to avoid case sensitivity
sentence = sentence.translate(sentence.maketrans("", "", string.punctuation)) #removes punctuation from every line of the text file
words = sentence.split(" ") # split the lines into a list of words
for word in words: #loops through each word of the file
if len(word)>2: #checks if the length of the word is greater than 2
if word in wc: # if the word is already in dictionary
wc[word] = wc[word] + 1 #if the word is already present in dict wc then add 1 to the count of that word
else: #if the word is not already present
wc[word] = 1 # word is added to the wc dict and assign 1 to the count of that word
for w in list(wc.keys()): #prints the list of words and their number of occurrences
print(w, wc[w]) #prints word: occurrences in key:value format of dict
wordcount("file.txt") #calls wordcount method and passes name of the file to that method
Explanation:
The program has a function wordcount that takes the name of a text file (filename) as parameter.
open() method is used to open the file in read mode. "r" represents the mode and it means read mode. Then a dictionary is created and named as wc. The first for loop, iterates through each line (sentence) of the text file. strip() method is used to remove extra empty spaces or new line character from each sentence of the file, then each sentence is converted to lower case using lower() method to avoid case sensitivity. Now the words "hello" and "Hello" are treated as the same word.
sentence = sentence.translate(sentence.maketrans("", "", string.punctuation)) statement uses two methods i.e. maketrans() and translate(). maketrans() specifies the punctuation characters that are to be deleted from the sentences and returns a translation table. translate() method uses the table that maketrans() returns in order to replace a character to its mapped character and returns the lines of text file after performing these translations.
Next the split() method is used to break these sentences into a list of words. Second for loop iterates through each word of the text file. As its given to ignore words of length 2 or less, so an IF statement is used to check if the length of word is greater than 2. If this statement evaluates to true then next statement: if word in wc: is executed which checks if the word is already present in dictionary. If this statement evaluates to true then 1 is added to the count of that word. If the word is not already present then the word is added to the wc dictionary and 1 s assigned to the count of that word.
Next the words along with their occurrences is printed. The program and its output are attached as screenshot. Since the frankenstein.txt' is not provided so I am using my own text file.
An organization is struggling to differentiate threats from normal traffic and access to systems. A security engineer has been asked to recommend a system that will aggregate data and provide metrics that will assist in identifying malicious actors or other anomalous activity throughout the environment. Which of the following solutions should the engineer recommend?a. Web application firewall b. SIEM c. IPS d. UTM e. File integrity monitor
Answer:
b. SIEM.
Explanation:
In this scenario, an organization is struggling to differentiate threats from normal traffic and access to systems. A security engineer has been asked to recommend a system that will aggregate data and provide metrics that will assist in identifying malicious actors or other anomalous activity throughout the environment. The solution the engineer should recommend is the Security information and event management (SIEM).
Security information and event management is an enterprise software that provides a holistic view and analyzes activity from various resources across an entire information technology (IT) infrastructure.
The SIEM is used to aggregate important data from multiple source such as servers, routers, firewall, switches, domain controllers, antivirus software and analyzes the data to detect any threat, deviation from the norm, as well as investigate in order to take appropriate actions. Some examples of the SIEM system are IBM QRadar, Splunk, LogRhythm etc.
If distances are recorded as 4-bit numbers in a 500-router network, and distance vectors are exchanged 3 times/second, how much total bandwidth (in bps) is used by the distributed routing algorithm
Answer:
A total of 6,000 bps of bandwidth is used by the distributed routing algorithm
Explanation:
This is a bandwidth requirement question.
We proceed as follows;
To calculate the total number of bits for a routing table, we use the following formula;
Routing table=Number of routers * length of cost
we are given the following parameters from the question;
Number of routers = 500
length of cost = 4 bits
Routing table = 500*4
=2000
Hence, a routing table is 2000 bits in length.
Now we proceed to calculate the bandwidth required on each line using the formula below;
Bandwidth = no.of seconds * no.of bits in routing table
Bandwidth required on each line = 3*2000
=6000