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
DerKrebs [107]
4 years ago
13

Define a function below called increase_elements_by_x, which takes two arguments - a list of numbers and a single positive numbe

r (you might want to call it x). Complete the function such that it returns a copy of the original list where every value is increased by the second argument. For example, given the inputs [1,2,5] and 2, your function should return [3,4,7].
Computers and Technology
1 answer:
zubka84 [21]4 years ago
5 0

Answer:

function

increase_elements_by_x (list, x)

{

 var tplist = [];

 for (i = 0; i < list.length; i++)

   {

     tplist[i] = list[i] + x;

   print (tplist[i])}

 return tplist;

}

var list =[1, 3, 5];

var copyList;

var x = 3;

copyList = increase_elements_by_x (list, x);

print (copyList);

Explanation:

Create a list named list with initial data 1,3,5.

Create a function name increase_elements_by_x  which takes list and number as argument.Create empty list tplist. Loop through list, for ever index add x to list[index] and save to an empty list tplist. After loop is exited return tplist.

create a variable copylist and set it to increase_elements_by_x. Value returned by increase_elements_by_x  will be saved in copylist. print copy list to see content of copy list.

You might be interested in
List the general steps that are used to configure a soho router and set up the network
marusya05 [52]
Configure the Internet connection. 

Configure the wireless router. 

Enable NAT. 

Configure DHCP

Secure the SOHO network.
7 0
4 years ago
What is the dividend rate for ibm stock?
Vaselesa [24]
3.28% I think 
......................................................................................................................................
5 0
3 years ago
After installing the processor, if the system begins the boot process and suddenly turns off before completing the boot, the pro
NikAS [45]

Answer:

A. True

Explanation:

Be sure your processor is receiving sufficient cooling by verifying if there is a heatsink on it. If there is, make sure that it's inserted fully into cpu_fan port on the motherboard. If the boot process still turns off, you may have a defective processor or replace the motherboard.

8 0
4 years ago
Which word processing tool can help you find synonyms to improve your word choice?
deff fn [24]
Grammarly is the answer
6 0
4 years ago
Read 2 more answers
Question in file i need this work done tonight
inysia [295]
This is to much work for 5 points cmon
3 0
2 years ago
Other questions:
  • Create a class named BaseballGame that contains data fields for two team names and scores for each team in each of nine innings.
    12·1 answer
  • How is the Task Manager helpful in displaying which resources your computer is using and how fast?
    5·2 answers
  • High Frequency Traders are
    5·1 answer
  • All of the following are forms of verbal communication except
    12·2 answers
  • Which one of the following characteristics or skills of a ScrumMaster are closelyaligned with coaching?Select one:
    5·1 answer
  • _____ is a subset of a data warehouse in which only a focused portion of the data warehouse information is kept. A. Data diction
    6·1 answer
  • 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
    12·1 answer
  • Find a 95% confidence interval for the mean failure pressure for this type of roof panel.The article "Wind-Uplift Capacity of Re
    7·1 answer
  • 9. Select the correct answer.
    6·1 answer
  • Which of the following terms best describes the product development life cycle process?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!