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
Talja [164]
4 years ago
12

(50 points) Write a programthat adds the first and last elements of an integer array and stored as the first element of the outp

ut array, adds the second and second-to-last elements and stored as the second number, and so on. If the array hasan odd number of integers, leave the central integer inthe original arrayunchanged.
Computers and Technology
1 answer:
Elena L [17]4 years ago
3 0

Answer:

A is the input array

B = [] ; %B is initially an empty array

for i = 1:length(A)/2  %iterates over A until the midpoint of A

   B(i) = A(i) + A(end + 1 - i);  %This adds the numbers from the first half and %second half of A, and stores in B

end

disp(B)

You might be interested in
What’s the best way to figure out what wires what and goes where?
igor_vitrenko [27]
Try to untangle them, First!
Then the color of the wire must match the color hole it goes in (I’m guessing)
I’m not good with electronics so sorry.
6 0
4 years ago
A Windows user called the help desk to request that her local user account password be reset on her computer. The help desk tech
lara [203]

Answer:

C. The user had previously encrypted her data files and folders using EFS.

Explanation:

The most likely reason for the lost data files is that the user had previously encrypted her data files and folders using EFS.

7 0
3 years ago
100 POINTS PLEASE HELP
Oksana_A [137]

Answer:

hope this helped ,do consider giving brainliest

Explanation:

import numpy as np

#PrintArray Function

def printArray(array):

for i in range(len(array)):

for j in range(len(array[i])):

print(array[i][j], end= " ")

print()

#Flip horizontal function

def flipHorizontal(array):

#reversing the order of arrays

array2 = np.fliplr(array).copy() printArray(array2)

#Flip Vertical function

def flipVertical(array):

#Preserving the order of array and reversing each array.

array3 = np.flipud(array).copy() printArray(array3)

#Main() function def main():

array = [[0,2,0,0,0],[0,2,0,0,0],[0,2,2,0,0],[0,2,0,2,0],[0,2,0,0,2]]

print("The array: \n")

printArray(array)

print("\nFlipped horizontally: \n") flipHorizontal(array)

print("\nFlipped vertically: \n") flipVertical(array)

if __name__=="__main__":

main()Explanation:

6 0
2 years ago
Read 2 more answers
"Margaret has $3,200 cash after selling off her television, DVD player, and computer. She has debts of $4,800 owing to the follo
serg [7]

Answer: Hyatt's  will be able to collect $1,365

Explanation: Composition Agreement is a kind of agreement reached between a debtor and its creditors. it a kind of agreement whereby the debtor and creditors agree to collect a percentage of their debts to fully settle their debts from the creditor.

For instance Margaret with a cash of $3,200 to settle a debt of $4,800.

In this case Margaret can decide to pay 65% of the total debts to settle the final debts. Here, Hyatt's  will be able to collect $1,365 as full settle of his debt.

5 0
3 years ago
Hey can someone help?
Zinaida [17]
Send an email to it!
4 0
3 years ago
Read 2 more answers
Other questions:
  • python Write a class named Taxicab that has three **private** data members: one that holds the current x-coordinate, one that ho
    10·1 answer
  • Which option enables you to keep the last grammatical change
    15·2 answers
  • An example of a historical challenge of STAMIS is
    13·2 answers
  • Joshua needs to join in two cells together which of the following would perform the function
    14·1 answer
  • Convert 42DB5000 base 16 to base 10 floating point form assuming this is a signed floating point encoding (IEEE754) (32-Bit)
    10·1 answer
  • Which is a primary document?<br> a. letter<br> b. dictionary<br> c. textbook<br> d. website
    11·1 answer
  • An input value has to be greater than 18 and less than 65 if a driving license is to be approved for issue. What type of input c
    11·1 answer
  • Help on What i should say to my IT school lady? Read all three pages
    10·1 answer
  • Design a base class, Road, with the following members:
    13·1 answer
  • Write an algorithm to calculate the average<br> value of array of integer elements
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!