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
WITCHER [35]
2 years ago
8

Write a function swaparrayends() that swaps the first and last elements of the function's array parameter. ex: sortarray

Computers and Technology
1 answer:
Katena32 [7]2 years ago
3 0
Def swapArrayEnds( array ):
    tmp = array[ len( array ) - 1 ]
    array[ len( array ) - 1 ] = array[ 0 ]
    array[ 0 ] = tmp


You might be interested in
Write code which takes a user input of a String and an integer. The code should print each letter of the String the number of ti
Alexus [3.1K]

import java.util.Scanner;

public class JavaApplication70 {

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Input a String:");

       String txt = scan.nextLine();

       System.out.println("Input an integer:");

       int num = scan.nextInt();

       String newTxt = "";

       int w = 0;

       for (int i = txt.length()-1; i >= 0; i--){

           char c = txt.charAt(i);

           while (w < num){

               newTxt += c;

               w++;

           }

           w = 0;

       }

       System.out.println(newTxt);

   }

   

}

I hope this helps!

7 0
3 years ago
Read 2 more answers
so you just gonna bring me a birthday gift on my birthday to my birthday party on my birthday with a birthday gift
Marina86 [1]

Answer:

Happy birthday.?

Explanation:

*GLASS BREAKS*

5 0
2 years ago
Read 2 more answers
The __________ energy in food is changed into mechanical energy by your muscles.
qwelly [4]
The chemical energy in food is transformed into mechanical energy through a process called respiration. This isn't really a computers and technology question though. Try Biology next time.
4 0
2 years ago
If you are weak or lacking in an area or skillset, what kinds of things can you do to compensate or improve?
Ilya [14]
Put some more of your time to help improve that skill.try to learn to get better.
6 0
2 years ago
Which decimal number is equivalent to the hexadecimal number F1?
Papessa [141]

Answer:

C

Explanation:

8 0
2 years ago
Other questions:
  • You are logged in as a user with limited system privileges, you are the linux system administrator and you have the password to
    5·1 answer
  • What type of rain happens when cold air meets warm air
    14·1 answer
  • In the Microsoft publisher application, words underlined in red are ____.
    6·1 answer
  • Somebody who is good at this stuff, please halp meh ;-;
    6·1 answer
  • A Windows user has been successfully saving documents to the file server all morning. However, the latest attempt resulted in th
    9·2 answers
  • Your friend has a great idea for a new app, and she shows you a document that outlines what the app will do. This document is an
    6·1 answer
  • What is one disadvantage of transmitting personal data using digital signals?
    15·2 answers
  • Programming that relies on the use of objects and methods to control complexity and solve problems is known as what type of prog
    7·1 answer
  • These are pictorial images displayed on a computer screen​
    8·1 answer
  • You want to connect to a user desktop to review windows 10 configuration settings when the user is not present. which technology
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!