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
Fudgin [204]
3 years ago
11

The scheme function (mult2-diff Ist) should take one argument, a list of numbers, and results in multiplying each number in the

list by two and then computing the difference of those numbers, e.g.: (mult2-diff'(912)) should evaluate to the difference of 18, 2 and 4: (18-2)-4, or 12. Finish mult2-diff below: (define (mult2-diff lst) (if
Computers and Technology
1 answer:
JulijaS [17]3 years ago
6 0

Answer:

The solution code is written in Python.

  1. def mult2_diff(lst):
  2.    num_list = []
  3.    for x in lst:
  4.        num_list.append(x * 2)
  5.    diff = num_list[0]
  6.    for i in range(1, len(num_list)):
  7.        diff = diff - num_list[i]
  8.    
  9.    print(diff)

Explanation:

Firstly, based on the requirement stated in the question, define a function <em>mult2_diff() </em>that takes one argument, <em>lst</em>, which is a list of numbers (Line 1).

This function is expected to multiply each number in the list by two and then followed with computing the difference. To do so, let's try to attempt the first function task, multiplying numbers.  Create a new list, num_list, to hold the multiplied numbers (Line 2). Use a for loop to traverse through each number in the input list, <em>lst</em>, and multiply each of them by two and add it to the <em>num_list </em>(Line 4-5).

To attempt the second function task, create another variable, <em>diff</em>, to hold the value of calculated difference between the numbers in the <em>num_list</em>. Initialize <em>diff </em>with the first number in the <em>num_list</em>. Use a another for-loop to traverse through each number in the num_list starting with second index, <em>1</em>, and calculate the difference between the <em>diff </em>and the current number extracted from the <em>num_list </em>through indexing.

At last print the output of <em>diff</em> (Line 11).

You might be interested in
Where are you jaymann ive been looking for you
LuckyWell [14K]

Answer:

Explanation:

[[^hewoo I’m not em but thx for points

4 0
2 years ago
Read 2 more answers
Consider a relation BOOKS that holds information about the inventory of books (used or new) in a bookstore with attributes (titl
Yuri [45]

Answer:

See explaination

Explanation:

Somehing is considered functional dependent (FD) if a relationship between two attributes, typically between the PK and other non-key attributes within a table. For any relation R, attribute Y is functionally dependent on attribute X (usually the PK), if for every valid instance of X, that value of X uniquely determines the value of Y.

Please kindly check attachment for the other details.

5 0
3 years ago
________ a database rearranges data and objects in a database to make its size smaller
hodyreva [135]
<span>An attribute in a relation of a database that serves as the primary key of another relation in the same database is called a

</span>
8 0
3 years ago
PART 2 - Exercise 2 - Programming Assignment
Oliga [24]

Suppose that a linked list is used as a data structure for the hash table, create a program that includes steps his application counts the number of phrases in documents decided on via way of means of the user #include.

<h3>What is Programming?</h3>

It is the manner of making hard and fast commands that inform a pc the way to carry out a task. Programming may be finished the usage of lots of pc programming languages, inclusive of JavaScript, Python, and C++.

  1. This application counts the quantity of phrases in documents decided on via way of means of the user.
  2. #include
  3. #include
  4. #include the usage of namespace std; //Function 1 int count(string word)go back word.size();
  5. }
  6. //Function 2
  7. int vowel(string word)> filename;
  8. //Open the {input|enter">enter file.
  9. inputfile.open(filename.c_str()); cout<<"nWord listing after format";
  10. cout<<"n____nn"; //If the file succesfully opened, process it.if (inputfile).

Read more about program :

brainly.com/question/1538272

#SPJ1

5 0
2 years ago
If you are the Head of H.R Department in Ali Manufacture Company and you have hire the totally fresh candidates in your company
cluponka [151]

Answer:

on the job training

Explanation:

I would personally suggest on the job training. This is because it provides the new candidates specific experience on how the job will be on a day-to-day basis. This can drastically increase the performance of hired candidates since they will know exactly what and how to perform for that exact company. Also, it will help the candidates get acquainted with the other current employees and even get rid of candidates who would have eventually quit by showing them exactly what the job will be like. Some candidates will realize that the job is not right for them and simply give up and quit.

7 0
3 years ago
Other questions:
  • Using the expected format, of putting key information where the reader can’t find it, is an example of?
    8·2 answers
  • 1. Define a C++ function with the name evaluateBook. The function receives as one argument the name of the file to be processed
    13·1 answer
  • Discuss some design considerations that you should keep in mind when you want to design a professional-looking flyer or newslett
    12·1 answer
  • You have a notebook computer and wish to connect to an IEEE 802.11n wireless network. The computer does not have a built-in wire
    11·1 answer
  • The CSS property of top , bottom , left , or right moves the element the specified distance from the respective edge of the clos
    7·1 answer
  • In reference to computer communications, what does the term noise mean?
    8·2 answers
  • Write a programme with C++ language wich print the biggest number in between three numbers , whith INT
    14·1 answer
  • A(n) _______ gate provides an output of 1 if either or both inputs are 1.
    14·2 answers
  • The Operating System is used to locate, move, and copy files.
    10·1 answer
  • Write an algorithm to show whether a given number is even or odd.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!