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
ANEK [815]
3 years ago
14

g Write a general-purpose program with a loop and indexed addressing that calculates sum of the values of elements of a DWORD ar

ray that are located at multiple of 4 location. For example for the array 1,2,3,4,5,6,7,8,9,10,11,12,13,14
Computers and Technology
1 answer:
Vikki [24]3 years ago
7 0

Answer:

def sumD4th(dword):

   select = dword[3::4]

   print(sum(select))

mylist = [1,2,3,4,5,6,7,8,9,10,11,12,13,14]

sumD4th(mylist)

Explanation:

The python program above defines a function called "sumD4th" that accepts a list as its argument. The variable "select" is created which is the subset of the list argument "mylist" containing the index items that is a sum of four. The output of the function is the sum of the items in the "select" list.

You might be interested in
Design and implement an algorithm that gets as input a list of k integer values N1, N2,..., Nk as well as a special value SUM. Y
satela [25.4K]

Answer:

Follows are the code to this question:

def FindPair(Values,SUM):#defining a method FindPair  

   found=False;#defining a boolean variable found

   for i in Values:#defining loop for check Value  

       for j in Values:#defining loop for check Value

           if (i+j ==SUM):#defining if block that check i+j=sum

               found=True;#assign value True in boolean variable

               x=i;#defining a variable x that holds i value

               y=j;#defining a variable x that holds j value

               break;#use break keyword

       if(found==True):#defining if block that checks found equal to True

           print("(",x,",",y,")");#print value

       else:#defining else block

           print("Sorry there is no such pair of values.");#print message

Values=[3,8,13,2,17,18,10];#defining a list and assign Values

SUM=20;#defining SUM variable

FindPair(Values,SUM);#calling a method FindPair

Output:

please find the attachment:

Explanation:

In the above python code a method, "FindPair" is defined, which accepts a "list and SUM" variable in its parameter, inside the method "found" a boolean variable is defined, that holds a value "false".

  • Inside the method, two for loop is defined, that holds list element value, and in if block, it checks its added value is equal to the SUM. If the condition is true, it changes the boolean variable value and defines the "x,y" variable, that holds its value.
  • In the next if the block, it checks the boolean variable value, if the condition is true, it will print the "x,y" value, otherwise, it will print a message.  

6 0
3 years ago
A(n) ____ is a program that you use to create simple text files.
tatiyna

A <u>Text editor </u>is a program that you use to create simple text files.

<h3>What is the text editor?</h3>

A text editor is known to be a kind of a computer program that is known to give room for a user to be able to enter, alter , store, and also be able to print text (such as characters as well as numbers, each is known to be encoded by the computer as well as its input and output devices, set up to have meaning to a given users or to other kinds of programs).

Therefore, based on the above, one can say that A <u>Text editor </u>is a program that you use to create simple text files.

Learn more about Text editor from

brainly.com/question/4004088
#SPJ1

A(n) ____ is a program that you use to create simple text files. a. text editor b. IDE c. GUI d. GDE.

3 0
1 year ago
You have video-recorded a friend’s birthday party. You compressed the video so it uploads quickly. What are some signs that you
Hatshy [7]

Answer:

(A) graphical glitches (B) choppy frames (D) sound that does not match motion

Explanation:

I did the assignment and (A) (B) (D) were correct.

                                           hope it helps

4 0
3 years ago
URGENT PLEASE HELP!!!!!
Allisa [31]

Answer:

in my opinion I choose the rule of simplification

7 0
3 years ago
Which element of the word window is to the right of the screen
sesenic [268]

Answer: task pane

Using the task pane When opened, the task pane will appear on the right side of the Word window. The task pane provides easy access to commonly used menus, buttons, and tools.

Hope this helps....... Stay safe and have a Merry Christmas!!!!!!!!! :D

7 0
3 years ago
Read 2 more answers
Other questions:
  • The _____ is the mechanism inside a computer that actually does the arithmetic and logical operations.
    15·1 answer
  • Which variable name is the best to hold the area of a rectangle?<br> 1A<br> area<br> AREA<br> a
    13·1 answer
  • What does the Chart Elements option allow you to change? A. Values B. Color C. Style D. Axis titles
    13·1 answer
  • Explain the four basic operation performed by every computer​
    11·2 answers
  • Which one of them are the correct answers?
    7·1 answer
  • What is a database backup, and how is it used?
    13·1 answer
  • What is malware? a type of virus that spreads through a network connection a type of virus that targets programs and files any p
    8·1 answer
  • The intelligence displayed by humans and other animals is termed?
    15·1 answer
  • Tape is magnetic tape which sound ca be recorded , true or false?
    9·1 answer
  • You are working on a ticket for a user who cannot access the Internet from their PC. After troubleshooting, how do you confirm t
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!