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
zhuklara [117]
3 years ago
10

Write a static method reOrder56(int[] nums) that return an array that contains exactly the same numbers as the given array, but

has been reorderd so that every 5 is immediately followed by a 6. You may choose to move every other number with the exception of 5; You are not to move 5. The array contains the same number of 5's and 6's, every 5 has a number after it that is not a 5, and a 6 appears in the array before any 6.
Computers and Technology
1 answer:
denpristay [2]3 years ago
8 0

Answer:

Follows are the code to the given question:

static int[] reOrder56(int[] nums)//defining a static method reOrder56 that holds an array in parameter

{

   int x,y;//defining integer variables

   for(x=0;x<nums.length;x++)//using for loop that counts array  

   {

       if(nums[x]==5 && nums[x+1]!=6) //defining if block checks arry values

       {

           for(y=0;y<nums.length;y++)//use for loop to count array value again  

           {

               if(nums[y]==6 && nums[y-1]!=5)//defining if block checks arry values  

               {

                   nums[y] = nums[x+1];//swap the array element value

                   nums[x+1] = 6;//holing value in array

                   break;//break the condition

               }

           }

       }

   }

}

Explanation:

In this code, a static method "reOrder56" is declared that takes an integer array "nums" in its parameter, and inside the method, two integer variable "x, y" is defined, which is used in the nested loop.

In the first loop, it holds array values and uses the if block to check the array element value and define another loop to check the same condition, and this block, swap the value and holds the value in the array and breaks the condition.

You might be interested in
Where is the fill handle located
Ronch [10]
The fill handle will appear as a small square in the bottom-right corner of the selected cell(s). Click, hold, and drag the fill handle until all of the cells you want to fill are selected. Release the mouse to fill the selected cells
4 0
2 years ago
A data visualization tool that updates in real time and gives multiple outputs is called
strojnjashka [21]

Answer:

A data dashboard

Explanation:

3 0
2 years ago
To annotate a document with a remark for another reviewer to address, select the _____ feature. comments track changes annotatio
kupik [55]
Select the comments feature.

We use comments in our documents to track issues for follow up or make suggestions to other people. A comment is inserted inside a balloon or a box that appears in the document's margins. Whatever the situation you may be in, you can easily add comments in a word document.

 



6 0
2 years ago
Read 2 more answers
40 POINTS I NEED THESE ANSWERS ASAP GIVE ME THE RIGHT ASNWER AND ILL PUT YOU AS THE BRAINLIEST
Law Incorporation [45]
Having a filling system and keeping a clean desk is good time management tips (True)

Your wrists should be low,relaxed and resting on the frame of the keyboard while typing (False)

A correctly formatted memo will have a complimentary closing? (False)

Which professional business memo part is keyed first?
D.) TO

to type a capital letter "T" the typist will hold the right shift key with the right little finger, and then strike "t" with the left pointer (first) finger. (True)

in a standard block style letter, key the date to print ___ from the top edge of the page
D.) Double space (DS)

A search engine can help link you to information on how to format a buisness letter. (True)
7 0
3 years ago
PLEASE HELP ASAP!!!!!!!!!! WILL GIVE A BRAINLIEST!!!!!!
sattari [20]
The answer to this question is:

"Both work with computers, but only Bluetooth can be used in a headset"

The answer to this is true because Both computers can use/work with computer but Bluetooth can only connect to head set headset don't need wifi it needs Bluetooth and charging/plug

Your Welcome :)
5 0
2 years ago
Read 2 more answers
Other questions:
  • Cyberlaw consists of: a. only state statutes. b. only federal statutes. c. traditional legal principles that have changed becaus
    6·1 answer
  • Which statement most aptly defines the term networking?
    8·1 answer
  • To complete this quest, answer the following questions in the submission box below. Make x an array going from 0 to 100 by steps
    15·1 answer
  • In what country was the English royal family and nobility living before the Restoration?
    6·1 answer
  • Give three reasons why you think Clip Art is so widely used in many different types of documents.
    13·2 answers
  • A student will not be allowed to sit in exam if his/her attendance is less than 75% .
    8·1 answer
  • Which of the following is not a common input device?
    6·1 answer
  • Please list 15 safety rules that you think should be practiced in the Computer Technology classroom/lab.
    12·1 answer
  • An administrator has been asked to update a flow that was created as part of a recent update. When the administrator opens the f
    14·1 answer
  • In a relational database, information is organized into tables in which each row represents a(n ) ________. Group of answer choi
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!