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
Maurinko [17]
3 years ago
12

Write a method with the header public static void swapAdjacent(int[] values) that takes a reference to an array of integers valu

es and swaps adjacent pairs of elements: values[0] with values[1], values[2] with values[3], etc. For example, if you add the following test code to your main method: int[] a1 = {0, 2, 4, 6, 8, 10}; swapAdjacent(a1); System.out.println(Arrays.toString(a1));
Computers and Technology
1 answer:
andreev551 [17]3 years ago
3 0

Answer:

public static void swapPairs(int[] a){

   int len=a.length;

       if(len%2 ==0){

           for(int i=0; i<len; i=i+2){

               a[i]=a[i+1];

               a[i+1]=a[i];

               int[] b={a[i]+a[i+1]};

           }    

       }

       if(len%2 !=0){

           for(int j=0; j<len; j=j+2){

               a[j]=a[j+1];

               a[j+1]=a[j];

               a[len-1]=a[len-1];

               int[] b={a[j]+a[j+1]+a[len-1]};

           }

       }    

}

public static void printArray(int[] a){

   System.out.println(a);

}

You might be interested in
A use case description is the best place to start for the design of the forms for a user interface.​ True False
Veronika [31]

Answer:

false

Explanation:

6 0
3 years ago
It converts Assembly Language into machine language?​
docker41 [41]

Answer:

An assembler.

Explanation:

Input is (as with any programming language) files with lists of instructions (typically assembler mnemonics), output is a binary format representing these instructions in machine language.

6 0
2 years ago
Instructions:Select the correct answer from each drop-down menu.
mario62 [17]

when using a dark background for presentations you should use bright colors to contrast with it


this makes the informations much easier to see and read for example white text on black background

6 0
3 years ago
Blender questions
Tamiku [17]
<span>14. A mesh represents a(n) _____ object if its faces enclose a positive and finite amount of space. (1 point)

odd

connected

simple

convex



15. Which of the following is the 3-D view port? (1 point)

the standard layout used for new files

the polygon viewing on the default screen

straight line segments connecting two vertices

a single static image in 3-D

The answer for number 1, should be:
SOLID
</span><span>A mesh represents a solid object if its faces enclose a positive and finite amount of space
</span>
The answer for the second question is:
a single static image in 3-D
4 0
3 years ago
Read 2 more answers
What are some particular game ideas for a Roblox developer. *Ideas that weren't copied or done before (simulators, tycoons, you
Helga [31]

Hi! I've also been playing Roblox since 2009, and I know the struggle of wanting to create an "original" game that hasn't been made before on Roblox.

As a member of RAT and a fan of Polymorphic's games in that group, I just wanna say that the games you were a part of (and others, I'm sure) are amazing.

As for original games, that's unfortunately pretty difficult because Roblox Studio and the Roblox platform has some limitations as to what games you can create. However, I can still offer some ideas that I've always wanted to make, but couldn't because of my lack of scripting/building ability.

I used to be a huge fan of Pokemon, and games like Pokemon Arena X on Roblox. I've always wanted to make a game based off Pokemon, except instead of being limited to using 6 Pokemon at a time, I'd want to be able to build an army. For example, I want to be able to fight other trainers by commanding and summoning my various groups of Pokemon while flying on my Dragonite. Or having a separate cutscene when you encounter another trainer that looks something like Warlords 2: Rise of Demons (search this up on Google and you'll be able to see the format I'm talking about for a fight scene). If not a Pokemon conquest, maybe just another Pokemon minigame; those were always popular but ended up being deleted for reasons I'm not 100% sure of.

I've also always loved action games. What about making a game where you kill other Robloxians, but in order to do so, you have to possess NPCs within the game? You're a spirit with no power except the a starterpack of a few weapons and the ability to take over NPC bodies or characters, ranging from a snail that is extremely slow to someone who owns a gun or tank or whatever. I've never really thought about the details, but you can only possess a character for a certain amount of time before they realize they're being possessed and expel you. Then to switch "bodies", you have to spin a wheel or something and you can integrate game passes to improve probability.

These are just some ideas that you definitely don't even need to consider, and may not even be possible to integrate on Roblox's platform. But feel free to respond with your feedback or even add me on Roblox if you want to collaborate more. Just respond with your wishes and I'll get back to you when I come onto Brainly again.

Hope I was able to help :)

4 0
3 years ago
Read 2 more answers
Other questions:
  • What information on social networking sites could be used to discriminate against a potential employee
    9·1 answer
  • Where does a computer store it’s information
    11·1 answer
  • The feature that moves text from the right edge of a paragraph to the beginning of the next line as necessary to fit within the
    12·1 answer
  • ___________ is a technique that uses IT to develop an ongoing relationship with the purchasers or buyers of an organization's pr
    13·1 answer
  • What is a Forloop and what is it used for?
    7·2 answers
  • When code is compiled it
    6·2 answers
  • The objective of this task is to use Scapy to estimate the distance, in terms of number of routers, between your VM and a select
    7·2 answers
  • Different algorithms can be made to complete the same task in different ways.
    8·2 answers
  • Rewrite the Espresso Counter program to Swap or interchange any two rows of the output. Copy and paste just the interchanged par
    14·1 answer
  • Which of the following best describes the impact of Creative Commons?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!