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
Setler79 [48]
4 years ago
12

Define a function below, sum_numeric_vals, which takes a single dictionary as a parameter. The dictionary has only strings for k

eys, but can have string or integer values. Complete the function to calculate and return the sum of the integer values in the dictionary.
Computers and Technology
1 answer:
notka56 [123]4 years ago
3 0

Answer:

Following are the program in the Python Programming language.

#define function

def sum_numeric_vals(dic):

 #set and initialize the integer variable to 0

 sum_total = 0

 #set the for loop to extract the value of dictionary

 for val in dic.values():

   #set if condition to find the sum

   if type(val)==int:

     sum_total += val

 #return the sum of the values

 return sum_total

#set and initialize dictionary type variable

dic={"Two":2,"Four":4}

#call and print the function

print(sum_numeric_vals(dic))

<u>Output:</u>

6

Explanation:

Here, we define the function "sum_numeric_vals()" and pass an argument "dic", inside the function.

  • Set and initialize an integer data type variable "sum_total" to 0.
  • Set the for loop which extract the values of the dictionary.
  • Set the if conditional statement inside the loop to find the sum of the values of the dictionary.
  • Then, return the sum of the values of the dictionary.

Finally, we set and initialize the dictionary type variable "dic" and pass it in the function's argument list then, call the function through the print function

You might be interested in
Why is outfitting a workspace with video games in technology development company considered a strategic use of money
Romashka [77]

They can study what the video game consoles are made up of and how they work so that way the can implement them into their work.

4 0
4 years ago
Read 2 more answers
What structures in which lighting heating and other systems are controlled by computers
Ilia_Sergeevich [38]

Museum !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

8 0
3 years ago
________ is a dedicated device designed to manage encrypted connections established over an untrusted network such as the Intern
pantera1 [17]

Answer:

The correct answer to the following question will be Option B (VPN concentrator).

Explanation:

  • Virtual Private Network (VPN) is a virtual, limited-use network generated using protocol encryption and tunneling over physical, public network connections.
  • A dedicated tool for managing VPN connections built over an untrusted network, such as the Internet, is called a VPN concentrator.
  • It's a type of networking system that ensures secure VPN connections are established and messages are transmitted between VPN nodes.

Therefore, Option B is the right answer.

7 0
3 years ago
Write the following C function and main function;
Rina8888 [55]

Answer:

The program to this question can be given as:

Program:

#include <stdio.h> //include header files.

#include <limits.h>

//declaration of function

void find_three_smallest(int a[], int n, int *small, int *second_smallest, int *third_smallest);

//definitation of function

void find_three_smallest(int a[], int n, int *smallest, int *second_smallest, int *third_smallest)

{//function body.

int i, first_number, second_number, third_number;       //define variable.

// There should atleast be three values

if (n < 3)       //check condition.

{

printf(" Invalid Input ");      //print message.

return;

}

first_number = second_number = third_number = INT_MAX;

for (i = 0; i < n ; i ++)    //Using loop  

{

//conditional statements.

// If current element is smaller than first then update all

if (a[i] < first_number)            

{

third_number = second_number;

second_number = first_number;

first_number = a[i];

}

else if (a[i] < second_number )

{

third_number = second_number;

second_number = a[i];

}

else if (a[i] < third_number )

{

third_number = a[i];

}

}

//print values.

printf("The smallest value =%i\n",first_number);

printf("Second_smallest value =%i\n",second_number);

printf("Third_smallest value =%i\n",third_number);    

}

//main method

int main()

{

int num, small, second_small, third_small; //define variable.

int x[6] = {1,3,4,5,1,2};         //define 1-D array.

num = sizeof(x)/sizeof(x[0]);  

find_three_smallest(x,num ,&small, &second_small, &third_small);       //calling function.

return 0;

}

Output:

The smallest value = 1

Second_smallest value = 1

Third_smallest value = 2

Explanation:

In the above C language program firstly we declare a function that's name is already given in the question.  

In this function we define the variable that takes all value from the main function and checks that the given values(numbers) are greater then 3. if the value is greater then 3 functions arranged values and finds the smallest, second smallest and third smallest value and print it. In the main function, we define a 1_D array. In that array, we assign the value and pass the value to the function. In the next line, we calling the function.  

8 0
3 years ago
What is abstraction and how does it relate to how computers store information?
Anton [14]

Answer:

Definition - What does Abstraction mean?

Abstraction is a fundamental principle in some types of computer science. It is a key design aspect of object-oriented programming languages and application programming interfaces. It's also one of the least understood ideas in programming, partially for semantic reasons.

PLEASE MARK BRAINLIEST

Abstraction is commonly defined as the extraction of relevant information from a larger data set, where utilizing abstraction allows engineers and others to simplify a codebase.

Techopedia explains Abstraction

The reason this is confusing to many people is that abstraction doesn't “sound like” what it is, semantically. It sounds like making something more vague, because that's how we use it in general language.

However, in computer science, abstraction typically means simplification and separating the signal from the noise in order to make programming more efficient and effective.

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • Type the correct answer in the box.
    7·1 answer
  • You are designing a web application that stores static assets in an amazon simple storage service (s3) bucket. you expect this b
    12·1 answer
  • ____ refers to data, applications, and even resources stored on computers accessed over the Internet. Answer
    5·1 answer
  • You are consulting for a trucking company that does a large amount ofbusiness shipping packages between New York and Boston. The
    5·1 answer
  • 1. Write a program that grades arithmetic quizzes as follows: (4 points) a. Assume there are 23 questions in the quiz. b. Ask th
    10·1 answer
  • Minerals can form deep inside Earth’s crust by
    13·1 answer
  • What are the three types of mergers?
    8·1 answer
  • The GPS device in an automobile uses which communication channel?
    7·1 answer
  • Who plays rocket league on xbox?
    15·2 answers
  • Which of the following is true about stateless applications?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!