1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Alisiya [41]
2 years ago
7

Using the merge method of the Map interface, which statement correctly updates the salesTotalByDept map of type Map to update th

e sales total for a dept by an integer sales value? Question 3 options: salesTotalByDept.merge(dept, sales,(d,s) -> s + 1); sales.merge(salesTotalByDept, dept, (d,s) -> s + sales); dept.merge(salesTotalByDept, sales, (d,s) -> s + sales); salesTotalByDept.merge(dept, sales, (d,s) -> s + sales);
Computers and Technology
1 answer:
Alexxandr [17]2 years ago
7 0

Answer:

salesTotalByDept.merge(dept, sales, (d,s) -> s + sales);

Explanation:

In the above statement merge() method is being used which updates the salesTotalByDept map of type Map to update the sales total for a dept by an integer sales value.

Here dept and sales both are used and passed as a parameter to merge() method because salesTotalByDept can be update if both the information about sales and department are provided.

Map.merge() method is used to place new value under the given key if the key does not correspond to any value, or is used to update existing key with a given value.

You might be interested in
The stream cipher described in Definition 2.1.1 can easily be generalized to work in alphabets other than the binary one. For ma
Free_Kalibri [48]

Answer:

Check the explanation

Explanation:

1) supposing the keystream is a stream that is of random bits in Z26, we can describe a stream cipher based on the Latin Alphabet that is as follows (where A ↔ 0, B ↔ 1, C ↔ 2 etc):

y_{i} =x_{i} +k_{i} mod26

x_{i} =y_{i} -k_{i} mod26

2)

x_{i} =y_{i} -k_{i} = ” B ” − ” R ” = 1 − 17 = − 16 ≡ 10 mod 26 = ” K ” etc ·

The Decrypted Text is: ”KASPAR HAUSER”

8 0
3 years ago
An index purports to speed data retrieval. you, therefore, index every attribute in each table. select the likely consequence.
stira [4]

Answer:

b. data entry slows as every INSERT , UPDATE, or DELETE statement must also update every index.

Explanation:

This process help to improve the speed of get data , it takes each element in the indexed column and save the location to get faster the data. But if you index every attribute in a table it going to take a lot of time locating each column in the respective index in each query(update, delete and insert). For that reason is necesary be carefull with this process and only put index in the relevant columns

4 0
3 years ago
Fill in the blanks to make the factorial function return the factorial of n. Then, print the first 10 factorials (from 0 to 9) w
nadezda [96]

Answer:

Following are code of factorial in python language

def factorial(n): # function

   result=1 #variable

   for x in range(2,n+1): #iterating the loop

       result=result*x  #storing result

   return result #return result

for n in range(10): #iterating loop

   print(n,factorial(n)) #print factorial

Output:

Following are the attachment of output

Explanation:

Missing information :

In the question the information is missing the code is missing which we have to correct it following are the code that are mention below.

def factorial(n): # function

   result=1 #variable

   for x in range(       ): #iterating the loop

       result=  #storing result

   return  #return result

for n in range(  ): #iterating loop

   print(n,factorial(n)) #print factorial

Following are the description of code

  • We have create a function factorial  in this we have pass the one parameter i.e "n".
  • In the for loop we have pass 2,n+1 which has been used to iterating the loop calculating factorial and string the result in the result variable
  • In the main function we have pass the range on which we have to calculated the factorial
  • Finally the print function will print the factorial .

Following are the attachment snip of code in the python language

3 0
2 years ago
What is the definition of legal intrusion
AleksAgata [21]
My answer -

intrusion of rights, right of privacy, trespass

P.S

Happy to help you have an AWESOME!!! day ^-^
5 0
2 years ago
Write a function swap that swaps the first and last elements of a list argument. Sample output with input: 'all,good,things,must
zubka84 [21]

Answer:

li=list(map(str,input().strip().split()))#taking input of the string.

#swapping first and last element.

temp=li[0]

li[0]=li[-1]

li[-1]=temp

print(li)#printing the list.

Explanation:

I have taken the list li for taking the input of strings.Then after that swapping first and last element of the list.Then printing the list.

7 0
2 years ago
Read 2 more answers
Other questions:
  • give two main reasons that should be considered when preparing and deploying a functional restoral scenario.
    5·1 answer
  • What two terms below describe a network device with three ports, two of which send and receive all traffic, and the third port m
    6·1 answer
  • Developers work together with customers and useras to define requirements and specify what the proposed system will do. If once
    9·1 answer
  • Hard drives are usually self-contained, sealed devices. Why must the case for the hard drive remain sealed closed?
    8·1 answer
  • How do you get free Wifi on your phone without paying
    6·1 answer
  • Why are specification for food processing tool,equipmentand untensils necessary?​
    8·1 answer
  • Displays are geared for a specific resolution. what is this resolution called?
    15·1 answer
  • A USB device used to transfer photos from the memory card to a hard drive is called a _____.
    5·2 answers
  • MULTIPLE CHOICE:
    15·1 answer
  • What is the difference between
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!