From the answer group below, select the correct combination of answers to be inserted into A through C in the program.
A school determines the letter grade that a student will receive based on the score, which is an integer value between 0 and 100, as follows:
The function grade receives a score (non-negative integer value between 0 and 100) and returns the letter grade as a character.
Answer group
From the answer group below, select the correct answer to be inserted into blank in the program.
A bus company operates buses between two cities. The standard ticket price is 20 US dollars and the discount ticket price for passenger aged 10 and under or aged 60 and over is 10 US dollars. Additionally, registered members of all ages always get the ticket at the discount price.
The function ticketPrice receives the arguments age (a non-negative integer value) and isMember (a boolean indicating that the passenger is a member if the value is true), which returns the value ret as the ticket price (in US dollars).
Answer group
From the answer group below, select the correct answer to be inserted into blank in the program.
The program outputs the even numbers between 1 and 100. Subsequently, it prints the sum of those even numbers. Note that division is performed for data type integer, that is, a ÷ b is the quotient of a divided by b.
Answer group
From the answer group below, select the correct combination of answers to be inserted into A and B in the program.
The function sumDigits receives a non-negative integer value num as argument, and returns the sum of the digits of num.
Answer group
From the answer group below, select the correct combination of answers to be inserted into A and B in the program.
The function division receives two integer values a and b and returns the quotient of a divided by b. The function modulus receives two integer values a and b and returns the remainder of a divided by b. The procedure convert receives the value of seconds as the input argument and outputs that value in the form of hours, minutes, and seconds. For example, when the procedure convert is called as convert( the output is “1, 30, 50”. Here, suppose that the range of input values satisfy 0 ≤ input < 86400.
Answer group
From the answer group below, select the correct answer to be inserted into blank in the program.
The function count1 receives the bit8 type (8-bit type) argument byte, and returns the number of bits 1 in the argument. For example, when the function count1 is called as count1(, the return value is 5.
Here, operator & represents a bitwise logical product, operator | represents a bitwise logical sum; operator >> represents a logical shift to the right, and operator << represents a logical shift to the left. For example, v << n performs a logical shift of the value of v by n bits to the left.
Answer group
From the answer group below, select the correct combination of answers to be inserted into A and B in the program.
The Fibonacci sequence is a sequence in which each number is equal to the sum of the two preceding numbers. In this question, the sequence starts with 0 and 1. The first 10 values in the sequence are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34. For example, the 8-th number 13 is the sum of the two preceding numbers 5 and 8.
The function fibo takes an integer value n as the argument and returns the value at the n-th position. Here, n reflects the position of the number in the sequence, starting with 1 (one). When n is 9, the function returns 21.
Answer group
From the answer group below, select the correct combination of answers to be inserted into A through C in the program. Here, the array index starts at 1.
The program implements a stack. The stack implementation only accepts positive integers. The function empty checks whether the stack is empty. The function full checks whether the stack is full. If the stack is not full, the function push pushes an element with a specified value onto the stack. If the stack is not empty, the function pop removes an element from the stack and returns its value. In the program, areas outside of the array must not be referenced.
Answer group
From the answer group below, select the correct combination of answers to be inserted into A through C in the program. Here, the array index starts at 1.
The procedure preorder traverses a binary tree and outputs the value of each node by following the sequence: root, left subtree, and right subtree using a stack (Last In, First Out). Each node of the binary tree is represented by the class Node. The table shows the description of the class Node. The Node-type variable holds a reference to an instance of the class Node. The argument root holds a reference to the root of the binary tree, which is an instance of the class Node. In the program, areas outside of the array must not be referenced.
Table Class Node
Answer group
From the answer group below, select the correct combination of answers to be inserted into A and B in the program.
The procedure Insert inserts an integer number given by the argument after the last element of the linear circular linked list. Each element of the linear circular linked list is represented by the class ListElement. The figure shows the description of the class ListElement. The ListElement-type variable holds a reference to an instance of the class ListElement. The global variable listHead holds a reference to the head element of the linear circular linked list. Remember that in the circular linked list the last element points to the listHead. Here, if the list is empty, listHead is set to undefined.
Figure Class ListElement
Answer group
From the answer group below, select the correct combination of answers to be inserted into A through C in the program. Here, the array index starts at 1.
The program sorts the data in ascending order using the selection sort algorithm. The algorithm repeatedly selects the smallest element from the unsorted portion of the array and swaps it with the first element of the unsorted portion until the entire array is sorted.
Answer group
From the answer group below, select the correct answer to be inserted into blank in the program.
A string of character(s) is called a palindrome if it reads the same forwards and backwards. Here the input string consists of only the uppercase Roman alphabet. As an example, the string "MADAM" is a palindrome as it remains the same when written backwards (right to left). The procedure isPalindrome receives a string str as a parameter and outputs whether the string str is a palindrome or not. The procedure should use the minimum number of iterations for any number of characters in the string. Note that division is performed for data type integer, that is, a ÷ b is the quotient of a divided by b.
Answer group
From the answer group below, select the correct combination of answers to be inserted into A through C in the program. Here, the array index starts at 1.
The function are_brackets_balanced checks for balanced brackets. It parses the given array of characters and when an opening bracket (“(”, “[”, “{”) is encountered, this is pushed onto the stack. When a closing bracket (“)”, “]”, “}”) is encountered, an element is popped from the stack and tested if it corresponds to the opening bracket. If the closing bracket matches its corresponding opening bracket, the process continues. Otherwise, it fails and the function returns false. After all characters have been processed, it returns false if any characters remain on the stack, otherwise it returns true. For simplicity, only brackets are considered as arguments to the function. The table shows examples of arguments provided to are_brackets_balanced and the return values.
Table Examples of arguments provided to the function are_brackets_balanced and the return values
The function are_brackets_balanced uses class Stack. The figure describes class Stack.
Figure Class Stack
Answer group
From the answer group below, select the correct answer to be inserted into blank in the description. Here, the array indexes start at 1.
The function calcSim takes two vectors (arrays) as input, calculates their similarity, and returns a value that characterizes the similarity. A large similarity indicates that the vectors are similar, and a small similarity indicates that the vectors are dissimilar. For example, to quantify the similarity between two documents, you can create a vector of occurrences of some words for each of the two documents and input them into calcSim. When the function calcSim( is called, the return value rounded to the first decimal place is blank.
Answer group
From the answer group below, select the correct combination of answers to be inserted into A and B in the program. Here, the array index starts at 1.
N-grams are continuous sequences of words, symbols, or tokens in a document. N-grams of texts are extensively used in text mining and natural language processing tasks. An n-gram model is built by counting how often word sequences occur in corpus text and then estimating the probabilities. The figure shows an example of the unigrams, bigrams, and trigrams of the example sentence “ITPEC includes members from 6 countries.”
Figure Example of unigrams, bigrams, and trigrams
The procedure NGRAMS generates n-grams from text and outputs them. If the argument for n is 1, the procedure outputs the unigram result. If n is 2, the procedure outputs the bigram result and so on. The input text is a string of words separated by a space, so it is needed to split the string to generate n-grams. The table shows the description of the functions used in the program. In this question, the operator “+” is used for both arithmetic calculation of integer data type and concatenation of one or more strings into one string. In the program, areas outside of the array must not be referenced.
Table Functions
Answer group
From the answer group below, select the correct combination of answers to be inserted into A and B in the program.
The function m_sin calculates and returns the approximate value of sin(x) for the argument x using the Maclaurin expansion. The program calculates sin(x) using the approximate formula below:
sin(x) = x/1! - x3/3! + x5/5! - … + (-1)n × ( x(2n+1)/(2n+1)!)
Here, ! is the factorial symbol, and n is the first integer for which | x(2n+1) / (2n+1)! | ≤ 10-7 is satisfied.
Answer group
From the answer group below, select the correct combination of answers to be inserted into A and B in the description.
An information systems company S has a guideline related to any issue for workers doing their daily job. The company has an information security team responsible for related issues and updates workers’ knowledge on information security.
One morning, a company worker who had just started his daily job and successfully signed into the company’s enterprise system received the following email:
Soon, the worker realized that something wrong. He followed the guideline instead of clicking on the link in the email because he suspected this is a A attack, and it is typically conducted through B. He also informed the company’s information security team to deal with the issue.
A few days later, the worker received an email from the information security team leader. The email was to notify that the issue was resolved, thanking the worker for his responsibility in handling the case according to the guideline.
Answer group
From the answer group below, select the most appropriate combination of answers to be inserted into A through C in Table 1.
Company X is a small trading company. The company is about to provide a new e-commerce web site for customers to make purchases online. The company will also hosts its own email service for the employees to conduct business with partners and customers. Company X will utilize public key infrastructure (PKI) to provide security for both the web server and email service. PKI uses public key cryptography to manage the identity of servers or persons and is widely used on the Internet.
Mr. T, the IT support person of company X is assigned to prepare the web server and email service in accordance with the following requirements:
The actions taken by Mr. T are shown in Table 1.
Table 1 Actions taken by Mr. T
Answer group
From the answer group below, select the most appropriate combination of answers to be inserted into A and B in the following description.
Company Y is an online retailer providing e-commerce web applications for customers to make purchases online and also allows customers to post product reviews. The web application was developed and maintained in-house. The properties of the e-commerce web application are shown in Figure 1.
Figure 1 Properties of the e-commerce web application
Due to recent incidents with multiple customers reporting that their accounts were compromised, the management tasked the IT team to investigate and address the issues. The IT team found that many customer accounts logins were unnoticed by the actual account owners, and some of the accounts were used to post fake reviews. The IT team also discovered unauthorized access to the database with illegal queries executed with no trace of administration login.
The IT team concluded that the incidents are most likely caused by using the same password on other leaked sites and A. They proposed to implement 2-factor authentication and B to mitigate respective issues in the future. The management then agreed to the plan, and the solutions was implemented accordingly.
Answer group
From the answer group below, select the correct combination of answers to be inserted into A through C in the description.
A zone is a group of interfaces that have similar functions or features. Zones establish the security borders of a network. A zone defines a boundary where traffic is subjected to policy restrictions when crossing into another region of a network. An inspection policy is applied to traffic moving between zones. Inter-zone policies offer considerable flexibility. Hence, different inspection policies can be applied to multiple host groups connected to the same router interface.
Company Z, intends to apply a zone-based policy firewall in their datacenter. Thus, they develop the network topology shown in Figure 1.
Figure 1 Network topology
These zones have the following characteristics:
The security policy for the datacenter should be:
Answer group