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
SOVA2 [1]
3 years ago
5

Assume that a 5 element array of type string named boroughs has been declared and initialized. Write the code necessary to switc

h (exchange) the values of the first and last elements of the array. So, for example, if the array's initial values were: brooklyn queens staten_island manhattan bronx then after your code executed, the array would contain: bronx queens staten_island manhattan brooklyn
Computers and Technology
1 answer:
hammer [34]3 years ago
6 0

Answer:

Explanation:

Let's do this in python. First we can set a placeholder variable to hold the first element of the array, then we can set that first element to the last element (5th) of that array. Then we set the last element of that array to the placeholder, which has value of the original first element of the array

placeholder = boroughs[0] # in python, 0 is the first element or arra

boroughs[0] = boroughs[-1] # -1 means the last element of the array

boroughs[-1] = placeholder

You might be interested in
Where would you go to add fractions to a document in adobe indesign
prisoha [69]

Just select the fraction text and choose Open Type > Fractions from the Character panel menu.

5 0
3 years ago
Guys helppppppppppppp!! plxxx <br> give me the right answer !
sweet-ann [11.9K]
Try "an online advertisement for a video game you recently read about in a blog post".

Hope I helped! :)
5 0
3 years ago
Consider the following Stack operations:
maxonik [38]

Answer:

Sequence of popped values: h,s,f.

State of stack (from top to bottom): m, d

Explanation:

Assuming that stack is  initially empty. Suppose that p contains the popped values. The state of the stack is where the top and bottom are pointing to in the stack. The top of the stack is that end of the stack where the new value is entered and existing values is removed. The sequence works as following:

push(d) -> enters d to the Stack

Stack:  

d ->top

push(h) -> enters h to the Stack

Stack:

h ->top

d ->bottom

pop() -> removes h from the Stack:

Stack:

d ->top

p: Suppose p contains popped values so first popped value entered to p is h

p = h

push(f) -> enters f to the Stack

Stack:

f ->top

d ->bottom

push(s) -> enters s to the Stack

Stack:

s ->top

f

d ->bottom

pop() -> removes s from the Stack:

Stack:

f ->top

d -> bottom

p = h, s

pop() -> removes f from the Stack:

Stack:

d ->top

p = h, s, f

push(m) -> enters m to the Stack:

Stack:

m ->top

d ->bottom

So looking at p the sequence of popped values is:

h, s, f

the final state of the stack:

m, d

end that is the top of the stack:

m

6 0
3 years ago
What are some commands found in the Sort dialog box? Check all that apply.
Novosadov [1.4K]

Answer:

A. add level

D. Delete level

E. Copy level

F. Move up or down

Explanation:

I just did it on edg. 2020

4 0
3 years ago
Read 2 more answers
Add me on xbox ahaha craig#6822 this is also just for points
Monica [59]

Answer:

sadly i dont have one:(

4 0
3 years ago
Read 2 more answers
Other questions:
  • Does anybody know how to use these showers?
    11·2 answers
  • The domain in an email message tells you the
    5·1 answer
  • Identify the most appropriate way to display the following research data.
    12·1 answer
  • Wide area networks are defined by their ability to
    14·2 answers
  • *hacked*
    12·1 answer
  • Explain why, with fast moving mobiles, speed is more dominant in characterizing the use mobility pattern than direction?
    8·1 answer
  • Why are typewriter keys arranged the way they are?
    14·1 answer
  • One of the most common encryption protocols in use today. It is an asymmetric protocol that enables the sharing of a secret key
    7·1 answer
  • What decides the amount of delay between shots on a digital camera?
    7·1 answer
  • Enthusiasm codehs 7.6.4 Write a function called add_enthusiasm that takes a string and returns that string in all uppercase with
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!