Summary
In this graded assignment, you will write Python programs that use loops to implement various algorithms.
Learning Outcomes
In completing this assignment, you will:
• Gain more experience converting an algorithm expressed using flowchart to one implemented in a Python program.
• Write a Python program using loops
Description
In a previous assignment in this course, you were asked to draw a flowchart for an algorithm that finds the two smallest items in a list, and then another assignment asked you to convert that flowchart to pseudocode.
Here is a pseudocode implementation of that algorithm:
1. min1- list
2. min2 - list,
3. for each item in list
4. if item 5. then if min1 6. then min2
7. else mint
8. else if item 9. then min2
10. output: min1, min2 item item item
Now, implement the algorithm in Python so that it correctly sets the values of min1 and min2 which should hold the two smallest values in the list, though not necessarily in that order.
In the code below, we have provided a list called "list" and initialized min 1 and min2 to hold the first two elements. Write your code starting at line 5 (you can remove the comments starting at line 6, and may need more space than what is provided), and be sure that the values of min1 and min2 are correctly set before the code reaches the "return (min1, min2)" statement on line 11.
As in the previous assignment, we will be using the Coursera automatic grading utility to test your code once you submit this quiz for grading, and this requires it to be within a function. So be sure that all of the code after line 1 is indented, and that you do not have any code after the "return (min 1, min2)" statement.
Keep in mind that the goal here is to write a program that would find the two smallest values of any list, not just the one provided on line 2. That is, don't simply set min 1 and min2 to-2 and -5, which are the two smallest values, but rather write a program that implements the algorithm from the flowchart and correctly sets min1 and min2 before reaching the return (min1, min2)" statement.
As before, you can test your program by clicking the "Run" button to the right of the code to see the results of any "print" statements, such as the one on line 10 which prints min1 and min2 before ending the function. However, please be sure that you do not modify the last two lines of the code block
1. def test(): # do not change this line!
2. list = [4, 5, 1, 9, -2, 0, 3, -5] # do not change this line!
3. min1 = list[0]
4. min2 = list[1]
5.
6. #write your code here so that it sets
7. #min1 and min2 to the two smallest numbers
8. # be sure to indent your code!
9.
10. print(min1, min2)
11. return (min1, min2) # do not change this line!
12. # do not write any code below here
13.
14. test() # do not change this line!
15. # do not remove this line!
Hints: The Python code for this algorithm is very similar to the pseudocode! Just be sure you are using the correct syntax. As in previous activities, don't forget that you can use the "print" function to print out intermediate values as your code is performing operations so that you can see what is happening

Answers

Answer 1
ima snatch them points from you cuz honestly i dont think any1 gna do it

Related Questions

A file concordance tracks the unique words in a file and their frequencies. Write a program that displays a concordance for a file. The program should output the unique words and their frequencies in alphabetical order. Variations are to track sequences of two words and their frequencies, or n words and their frequencies.
Below is an example file along with the program input and output:
example.txt
I AM SAM I AM SAM SAM I AM
Enter the input file name: example.txt
AM 3
I 3
SAM 3

Answers

Answer:

I am writing a Python program.

def concordance(filename):  # function that takes a file name as parameter and returns the concordance for that file

   file = open(filename,"r")  #opens file in read mode

   unique={}  #creates and empty list

   for word in file.read().split():  #loops through every word in the file

       if word in unique:  # if words is already present in the list

           unique[word] += 1  #add 1 to the count of the existing word

       else:    #if word is not present in the list

           unique[word] = 1 #add the word to the list and add 1 to the count of word

           file.close();  # close the file

   for x in sorted(unique):  #sort the list and displays words with frequencies

       print(x, unique[x]);  #prints the unique words and their frequencies in alphabetical order

#prompts user to enter the name of the file

file_name=input('Enter the input file name: ')

concordance(file_name)  #calls concordance method by passing file name to it

Explanation:

The program has a function concordance that takes a text file name as parameter and returns a list of unique words and their frequencies.

The program first uses open() method to open the file in read mode. Here "r" represents the mode. Then creates an empty list named unique. Then the for loop iterates through each word in the file. Here the method read() is used to read the contents of file and split() is used to return these contents as a list of strings. The if condition inside the loop body checks each word if it is already present in the list unique. If the word is present then it adds 1 to the count of that word and if the word is not already present then it adds that unique word to the list and assign 1 as a count to that word. close() method then closes the file. The second for loop for x in sorted(unique):  is used to display the list of unique words with their frequencies. sorted() method is used to sort the list and then the loop iterates through each word in the list, through x, which acts like an index variable, and the loop displays each word along with its frequency.

Kaiden would like to find the list of physical disk drives that are connected to a Linux system. Which directory contains a subdirectory for each drive

Answers

Answer:

The answer is "\root"

Explanation:

The root directory is the part of the Linux OS directory, which includes most other system files and folders but is specified by a forward slash (/). These directories are the hierarchy, which is used to organize files and folders on a device in a standardized protocol framework.  This root is also known as the top directory because it .supplied by the os and also is designated especially, that's why it is simply called root.

Which is the first step in the process of reading materials critically

Answers

Answer:

SQRRR or SQ3R is a reading comprehension method named for its five steps: survey, question, read, recite, and review. The method was introduced by Francis P. Robinson, an American education philosopher in his 1946 book Effective Study. The method offers a more efficient and active approach to reading textbook material

Why do you think it is necessary to set the sequence in which the system initializes video cards so that the primary display is initialized first

Answers

Answer:

Because if you don't do it BIOS doesn't support it. ... In troubleshooting a boot problem what would be the point of disabling the quick boot feature in BIOS setup

Explanation:

g Write a program that asks for the weight of a package and the distance it is to be shipped. This information should be passed to a calculateCharge function that computes and returns the shipping charge to be displayed . The main function should loop to handle multiple packages until a weight of 0 is entered.

Answers

Answer:

I am writing a C++ program:

#include <iostream>  //to use input output functions

#include<iomanip>  // to format the output

using namespace std;   // to identify objects like cin cout

void calculateCharge(double weight, double distance);   // function prototype

int main(){  //start of main() function body

  double w = 0.0, t = 0.0;  // w variable is for weight and t is for total

   unsigned int d = 0;   // d variable is to hold the value of distance

   calculateCharge(w, d); }  //calls calculateCharge method by passing weight and distance values to this method

void calculateCharge(double weight, double distance){  //method that takes weight and distance as parameters and compute the shipping charge

   double charge = 0.0;  //to store the value of shipping charges

   do {  // do while loop to handle multiple packages until a weight of 0 is entered

       cout << "Enter weight: " << endl;  //prompts user to enter weight

       cin >> weight;  //reads the input weight value

       if (weight == 0){  // if the value of weight is equal to 0

           break; }  // the loop breaks if value of weight is 0

       cout << "Enter distance: " << endl;  // if value of weight is not zero then the program precedes by prompting user to enter the value of distance

       cin >> distance;  //reads the input distance value

       cout << fixed << setprecision(2) << endl;  //set the precision to 2 means the sets the number of digits of an output to 2 decimal places

       if(weight <= 2)  //if the value of weight is less than or equals to 2

charge = (distance/500) * 3.10;  //compute the charge by this formula

else if(weight > 2 && weight <= 6)  //if weight is over 2 kg but not more than 6 kg

charge = (distance/500) * 4.20;  //charge is computed by multiplying value of distance to that of weight and if distance is greater than 500 then it is divided by 500 first

else if(weight > 6 && weight <= 10)  // if weight is over 6 kg but not more than 10 kg

charge = (distance/500) * 5.30;  //compute shipping charges by this formula

else  //if weight is over 10 kg

charge = (distance/500) * 6.40;   // compute shipping charge by multiplying value of distance to that of 6.40 weight value and if distance is greater than 500 then distance is divided by 500 first

cout << "Shipping charges: $" << charge << "\n";   //display the computed shipping charge

   } while (weight != 0);  //the loop continues to execute until weight 0 is entered

}              

Explanation:

The program is explained in the comments mentioned above. The program has a main() function that declares variable for weight, distance and total and then calls calculateCharge() method passing weight and dsitance in order to compute and return the shipping charge.

In calculateCharge() the user is prompted to enter the values for weight and distance. Then the based on the value of weight , the shipping charge is computed. Shipping charge is computed by multiplying the weight with distance. The distance is assumed to be 500 but if the distance entered by user exceeds 500 then the distance value is divided by 500 and then multiplied by the specified weight (according to if or else if conditions) in order to compute shipping charge. The program has a do while loop that keeps taking input from user until the user enters 0 as the value of weight.

The screenshot of the program and its output is attached.

Which is a software configuration management concept that helps us to control change without seriously impeding justifiable change?

Answers

Answer:

Baselines

Explanation:

The idea of software configuration management is that of monitoring and controlling changes in the software. The baseline is the standard and formally accepted form of a software item that is meant to be configured. It is like a generally accepted reference point, which could be applied in effecting incremental changes in the software.

There are three types of baselines which are the functional, developmental, and product baselines. Functional baselines provide an overview of the functionality and specifications of a system. The product baseline encompasses both the functional and physical details of the system.

Steve wants to take charge of his finances. To do so, he must track his income and expenditures. To accurately calculate his take-home pay, Steve must use his __________.

Answers

Answer:brain

Explanation:

to think

Write a function named twoWordsV2 that has the same specification as Problem 1, but implement it using while and not using break. (Hint: provide a different boolean condition for while.) Since only the implementation has changed, and not the specification, for a given input the output should be identical to the output in Problem 1.

Answers

Answer:

I am writing a Python program. Here is the function twoWordsV2:

def twoWordsV2 (length,firstLetter):#definition of function which takes length of the first word and first letter of the second word as parameter and returns these two words in a list

   word1 = "" # stores the first word

   word2= "" #holds the second word  

   while(len(word1)!=length): # checks if the input word1 length is not equal to the specified length

       word1 = input('A ' + str(length) + '-letter word please: ') #asks user to enter the input word1 of specified length

   while(word2!=firstLetter): #checks if the first character of input word2 is not equal to the specified firstLetter character

       word2 = input('A word beginning with ' + firstLetter+ ' please: ')#asks user to enter the input word2 begining with specified first letter

       if word2[0] == firstLetter.upper() or word2[0] == firstLetter.lower():#second word may begin with either an upper or lower case instance of firstLetter      

           return [word1,word2] #return the two words in a list                

   

#to check the working of the function use the following statement        

print(twoWordsV2(4,'B')) #calls twoWordsV2  method by passing 4 (length) and B (first letter)

Explanation:  

twoWordsV2 method has two parameters i.e length which is the length of the first word and firstLetter which is the first character of the the second word. This means the first word should be of specified length, and the second word should begin with a specified first letter. The function returns the two resultant words with the above specifications. These two words are displayed in a list. I will explain the working of the function with the help of an example:

Suppose length = 4 and firstLetter = 'B' and user enters "ok" as word1. input() method takes first word input from user.

The first while loop checks if the length of word1 i.e. ok is not equal to specified length i.e. 4. Length of word1 is checked using len function which returns 2 so length of word1 is 2. The loop condition is true because length of word1 i.e. 2 is not equal to specified length i.e. 4. So the body of the loop executes which displays this message:

A 4-letter word please:

Here notice that str(length) is changed to 4. This is because length=4 and str() converts this value into string.

So the above message keeps displaying until user enters a four letter word. Lets suppose user now enters "four". Now the while loop condition evaluates to false and the loop breaks. The program control  moves to the next line which is a while loop.

The second while loop checks if the first character of input word2 is not equal to the specified firstLetter character. Suppose word2 = "apple" and firstLetter= 'B'

Now the loop condition evaluates to true because word2 is not equal to first letter B. Now the main part of this while loop is the if condition: if word2[0] == firstLetter.upper() or word2[0] == firstLetter.lower() This statement checks if the first index of the word2 is equal to firstLetter. The word2 can contain a capital B or a small B so if condition checks both the cases by using upper and lower methods that converts the firstLetter to upper or lower and then match with the first letter of word2 i.e. the letter at index 0 of the word2. If this condition evaluates to true then next return statement returns the word1 and word2 in a list otherwise the second while loop keep asking user to enter the word2 with starting letter to be firstLetter i.e. 'B'.

The screenshot of the program and its output is attached.

The function for the given problem is:

def twoWordsV2 (length,firstLetter):word1 = "" # stores the first wordword2= "" #holds the second word   while(len(word1)!=length): word1 = input('A ' + str(length) + '-letter word please: ') while(word2!=firstLetter): word2 = input('A word beginning with ' + firstLetter+ ' please: ')if word2[0] == firstLetter.upper() or word2[0] == firstLetter.lower():    return [word1,word2]     print(twoWordsV2(4,'B')) Brief Explanation:

These 10 lines of code were written using the Python programming language and this was used to define, store and hold the function and then request input from the user, check if the given input was according to the required parameters, and then print the output.

Read more about python programming language here:
https://brainly.com/question/7015522

Recall that within the ArrayBoundedQueue the front variable and the rear variable hold the indices of the elements array where the current front and rear elements, respectively, of the queue are stored. Which of the following code sequences could be used to correctly enqueue element into the queue, assuming that enqueue is called on a non-full queue and that the code also correctly increments numElements?

a. numElements++; elements[rear) - element:
b. front++; elements(front) - element:
c. rear = (rear + 1) % elements.length; elements[rear) - element;
d. front = (front + 1) % elements.length; elements[front) - element;

Answers

Answer:

c. rear = (rear + 1) % elements.length; elements[rear] = element;

Explanation:

In the above statement:

Name of the array is elements.

rear holds current index of elements array where current rear element of queue is stored. Front are rear are two open ends of the queue and the end from which the element is inserted into the queue is called rear.

element is the element that is required to enqueue into the queue

Enqueue basically mean to add an element to a queue.

Here it is assumed that the queue is not full. This means an element can be added to the queue.

It is also assumed that code also correctly increments numElements.

rear = (rear + 1) % elements.length; This statement adds 1 to the rear and takes the modulus of rear+1 to the length of the array elements[]. This statement specifies the new position of the rear.

Now that the new position of rear is found using the above statement. Next the element can be enqueued to that new rear position using the following statement:

elements[rear] = element; this statement sets the element at the rear-th (new position) index of elements[] array.

For example we have a queue of length 5 and there are already 4 elements inserted into this queue. We have to add a new element i.e. 6 to the queue. There are four elements in elements[] array and length of the array is 5 so this means the queue is not full. Lets say that rear = 3

elements.length = 5

rear = 3

Using above two statements we get.

rear = (rear + 1) % elements.length;

       = 3 + 1 % 5

       = 4%5

      =  4

This computes the new position of rear. So the new position of rear is the 4-th index of elements[]. Now next statement:

elements[rear] = element;

elements[4] = 6

This statement adds element 6 to the 4-th index of elements[] array.

Thus the above statement enqueues element (element 6 in above example) into the queue.

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?

Answers

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]

Volume of Pyramid = A*h/3 where A is the area of the base of the pyramid and h is the height of the pyramid. Write a C++ program that asks the user to enter the necessary information about the pyramid (note that the user would not know the area of the base of the pyramid, you need to ask them for the length of one of the sides of the base and then calculate the area of the base). Using the information the user input, calculate the volume of the pyramid. Next display the results (rounded to two decimal places). Example Output (output will change depending on user input): The area of the base of the pyramid is: 25.00 The height of the pyramid is: 5.00 The volume of the pyramid is: 41.67 *Pseudocode IS required for this program and is worth 1 point. The program IS auto-graded.

Answers

Answer:

#include <iostream>

#include <iomanip>

using namespace std;

int main()

{

   double side, height;

   

   cout<<"Enter the length of one of the sides of the base: ";

   cin>>side;

   cout<<"Enter the height: ";

   cin>>height;

   

   double area = side * side;

   double volume = area * height / 3;

   

   cout<<"The area of the base of the pyramid is: "<<area<<endl;

   cout<<"The height of the pyramid is: "<<height<<endl;

   cout<<"The volume of the pyramid is: "<<fixed<<setprecision(2)<<volume<<endl;

   return 0;

}

Pseudocode:

Declare side, height

Get side

Get height

Set area = side * side

Set volume = area * height / 3

Print area

Print height

Print volume

Explanation:

Include <iomanip> to have two decimal places

Declare the side and height

Ask the user to enter side and height

Calculate the base area, multiply side by side

Calculate the volume using the given formula

Print area, height and volume (use fixed and setprecision(2) to have two decimal places)

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.

Answers

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.

A password checking system that disallows user passwords that are proper names or words that are normally included in a dictionary is an example of _____ with respect to security systems.

Answers

The answer is control

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++;
}

Answers

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);

}

Normally you depend on the JVM to perform garbage collection automatically. However, you can explicitly use ________ to request garbage collection.

Answers

Answer:

System.gc()

Explanation:

System.gc() can be defined as the method which can be used to effectively request for garbage collection because they runs the garbage collector, which in turn enables JMV which is fully known as JAVA VIRTUAL MACHINE to claim back the already unused memory space of the objects that was discarded for quick reuse of the memory space , although Java virtual machine often perform garbage collection automatically.

Write a method named removeDuplicates that accepts a string parameter and returns a new string with all consecutive occurrences of the same character in the string replaced by a single occurrence of that character. For example, the call of removeDuplicates("bookkeeeeeper") should return "bokeper" .

Answers

Answer:

//Method definition

//Method receives a String argument and returns a String value

public static String removeDuplicates(String str){

       //Create a new string to hold the unique characters

       String newString = "";

       

       //Create a loop to cycle through each of the characters in the

       //original string.

       for(int i=0; i<str.length(); i++){

           // For each of the cycles, using the indexOf() method,

           // check if the character at that position

           // already exists in the new string.

           if(newString.indexOf(str.charAt(i)) == -1){

               //if it does not exist, add it to the new string

               newString += str.charAt(i);

           }  //End of if statement

       }   //End of for statement

       

       return newString;   // return the new string

   }  //End of method definition

Sample Output:

removeDuplicates("bookkeeeeeper") => "bokeper"

Explanation:

The above code has been written in Java. It contains comments explaining every line of the code. Please go through the comments.

The actual lines of codes are written in bold-face to distinguish them from comments. The program has been re-written without comments as follows:

public static String removeDuplicates(String str){

       String newString = "";

       

       for(int i=0; i<str.length(); i++){

           if(newString.indexOf(str.charAt(i)) == -1){

               newString += str.charAt(i);

           }

       }

       

       return newString;

   }

From the sample output, when tested in a main application, a call to removeDuplicates("bookkeeeeeper") would return "bokeper"

Assemble a Server computer based on your budget (state the amount in Ghana Cedis), discussing the type of components (giving their exact names, model numbers, types, cost, architecture, etc.) you would need and give reasons why you need them. ​

Answers

Answer:

Following are the answer to this question:

Explanation:

The server would be generally a powerful processor instead of a desktop pc. It must choose the Dell server browser to choose a server for industrial applications.

Dell Poweredge R730 has been its pattern.  There should be the reason whether these servers are efficient, available, flexible, and support the concept of even a virtual environment.  Its same servers are easy to use, as well as the memory will be connected to this server is 8 TB.

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.

Answers

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.

Boolean expressions control _________________ Select one: a. recursion b. conditional execution c. alternative execution d. all of the above

Answers

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

Open up your database administraton GUI, and use the appropriate SQL Query Tool to write the SQL CREATE statement for your BOOK_TAGS table. You can either write the script manually and execute it through pgAdmin or you can create the table by using pgAdmin's wizard.
Afterwards, insert one row of dummy data that adds a tag to the sample book in the BOOKS table.

Answers

Answer:

nxlskshwhhwwlqlqoejebx znznxjslaa

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.

Answers

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.

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());

Answers

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)

A hotel salesperson enters sales in a text file. Each line contains the following, separated by semicolons: The name of the client, the service sold (such as Dinner, Conference, Lodging, and so on), the amount of the sale, and the date of that event. Write a program that reads such a file and displays the total amount for each service category. Display an error if the file does not exist or the format is incorrect.

Answers

Answer:

Life can get busy and hectic, but relationships matter. What is an effective way of mending relationships that may have had been neglected?Life can get busy and hectic, but relationships matter. What is an effective way of mending relationships that may have had been neglected?

Explanation:

Life can get busy and hectic, but relationships matter. What is an effective way of mending relationships that may have had been neglected?Life can get busy and hectic, but relationships matter. What is an effective way of mending relationships that may have had been neglected?Life can get busy and hectic, but relationships matter. What is an effective way of mending relationships that may have had been neglected?Life can get busy and hectic, but relationships matter. What is an effective way of mending relationships that may have had been neglected?Life can get busy and hectic, but relationships matter. What is an effective way of mending relationships that may have had been neglected?

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

Answers

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.

Oops, we made a mistake: we created a key "short" and gave it the value "tall", but we wanted to give it the value "long" instead. Write the line of code that will change the value associated with the key "short" to "long". Be consistent in whether you use single or double quotes to declare your strings: our autograder assumes you'll be consistent.

Answers

Answer:

Using java

//assuming that hashmap object name is ChangeMap

ChangeMap. replace("short", "long");

System.out.println("New HashMap: "

+ ChangeMap.toString());

Explanation:

From the above we have used the replace method to replace the value of the "short" key in the hashtable with "long" instead of the previous value "tall". We have used the printed the hashtable to the console using println and the ".toString()" method that we added to the function's parameter.

C++ Fibonacci
Complete ComputeFibonacci() to return FN, where F0 is 0, F1 is 1, F2 is 1, F3 is 2, F4 is 3, and continuing: FN is FN-1 + FN-2. Hint: Base cases are N == 0 and N == 1.
#include
using namespace std;
int ComputeFibonacci(int N) {
cout << "FIXME: Complete this function." << endl;
cout << "Currently just returns 0." << endl;
return 0;
}
int main() {
int N = 4; // F_N, starts at 0
cout << "F_" << N << " is "
<< ComputeFibonacci(N) << endl;
return 0;
}

Answers

Answer:

int ComputeFibonacci(int N) {

   if(N == 0)

       return 0;

   else if (N == 1)

       return 1;

   else

       return ComputeFibonacci(N-1) + ComputeFibonacci(N-2);

}

Explanation:

Inside the function ComputeFibonacci that takes one parameter, N, check the base cases first. If N is eqaul to 0, return 0. If N is eqaul to 1, return 1. Otherwise, call the ComputeFibonacci function with parameter N-1 and N-2 and sum these and return the result.

For example,

If N = 4 as in the main part:

ComputeFibonacci(4) → ComputeFibonacci(3) + ComputeFibonacci(2) = 2 + 1 = 3

ComputeFibonacci(3) → ComputeFibonacci(2) + ComputeFibonacci(1) = 1 + 1 = 2

ComputeFibonacci(2) → ComputeFibonacci(1) + ComputeFibonacci(0) = 1 + 0  = 1

*Note that you need to insert values from the bottom. Insert the values for ComputeFibonacci(1) and  ComputeFibonacci(0) to find ComputeFibonacci(2) and repeat the process.

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?

Answers

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

Answers

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.

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

Answers

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

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

Answers

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.

Other Questions
Which statement must be true if ? A.B.C.D. The length and width of a rectangular yard are 11 meters and 5 meters respectively. If each dimension were reduced by x meters to make the ratio of length to width 8 to 3, what would be the value of x What type of evidence is shown through each quotation? ""Approximately 50 million people living in the United States either lack health insurance entirely or are inadequately covered."" ""My brother Bob knows all about this risk."" A cylindrical container has a radius of 0.3 meter and a height of 0.75 meter. The container is filled with kerosene. The density of kerosene is 815 kg/m. What is the mass of the kerosene in the container? Enter your answer in the box. Use 3.14 for . Round your final answer to the nearest whole number. Gastrin, histamine, endorphins, serotonin, cholecystokinin, and somatostatin are hormones or paracrines that are released directly into the lamina propria. Which of the following cell types synthesize and secrete these products? a) parietal cells b) enteroendocrine cells c) mucous neck cells d) zymogenic cells Regarding Lyndon B. Johnsons presidency, which of the following statements is false? Group of answer choices LBJ enjoyed a large progressive majority in the House of Representatives LBJ worked with Congress, acting as a prime minister, shepherding bills through the legislature and keeping his party in line LBJ did not take advantage over the shock and mourning of President Kennedys assassination to advance his Great Society program LBJs Southern background allowed him to advance civil rights help please need now will give brainliest fleur wants to make tables and chairs. She has a total of 150 wooden boards and 330 nails. 17T + 6C 150 represents the number of tables T and chairs C she can make with 150 Wooden boards. 34T + 27C 330 represents the number of tables and chairs she can make with 330 nails. Does Fleur have enough boards and nails to make 3 tables and 9 chairs? Choose 1 answer: (Choice A) Fleur has enough boards and nails. (Choice B) Fleur has enough boards but not enough nails. (Choice C) Fleur has enough nails but not enough boards. (Choice D) Fleur has neither enough boards nor enough nails. Using the assembly-line balancing procedure, which of the following is the required cycle time in minutes per unit if the daily production time is 480 minutes and the required daily output is 50 units? a- 480 b- 0.104 c- Cannot be determined from the information above d- 50 e- 9.6 please help me with this TensesComplete the following sentences by putting them into thepast tense.1. Jenny throws the ball into the hoop. Which flowchart correctly lists the structures in order from smallest to largest?gene Right-arrow DNA Right-arrow chromosome Right-arrow nucleusgene Right-arrow chromosome Right-arrow DNA Right-arrow nucleusDNA Right-arrow gene Right-arrow chromosome Right-arrow nucleusDNA Right-arrow chromosome Right-arrow gene Right-arrow nucleus At December 31, 2017, Hawke Company reports the following results for its calendar year. Cash sales $1,905,000Credit sales 5,682,000. In addition, its unadjusted trial balance includes the following items.Accounts receivable $1,270,100 debit Allowance for doubtful accounts 16,580 debitReqiured:1. Prepare the adjusting entry for this company to recognize bad debts under each of the following independent assumptions.A. Bad debts are estimated to be 1.5% of credit sales. B. Bad debts are estimated to be 1% of total sales. C. An aging analysis estimates that 5% of year-end accounts receivable are uncollectible. 2. Show how Accounts Receivable and the Allowance for Doubtful Accounts appear on its December 31, 2015, balance sheet given the facts in part 1a.3. Show how Accounts Receivable and the Allowance for Doubtful Accounts appear on its December 31, 2015, balance sheet given the facts in part 1c. An account is today credited with its annual interest thereby bringing the accountbalance to $12,490. The interest rate is 5.70% compounded annually. You plan tomake annual withdrawals of $1,450 each. The first withdrawal is in exactly one yearand the last in exactly 9 years. Find the account balance immediately after the lastwithdrawal. To form the imperfect continuous you use imperfect tense of the verb ________ + the present participle of the verb that tells what you were doing. A. ser B. estar C. hacer D. decir Which of the following concepts was inadvertently challenged by Progressives' call for expertopinions?Woman's suffrageEfficiencyElected officials' autonomyMuckrakers' role Solve for x: |x| 8 = 5 (2 points) A. x = 13 and x = 3 B. x = 3 and x = 3 C. x = 3 and x = 13 D. No solution A group of hikers finished hiking at an elevation of -5 the group started hiking at an elevation of 8 What was the change in feet of the groups elevation Use the cubic model y = 10x3 12x to find the value of y when x = 9. tje mean of 12 scores is 8.8 what is the sum of tue 12 scores Two point charges of +2.0 C and -6.0 C are located on the x-axis at x = -1.0 cm and x 12) = +2.0 cm respectively. Where should a third charge of +3.0-C be placed on the +x-axis so that the potential at the origin is equal to zero?