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
Ierofanga [76]
3 years ago
5

Write a Java program that generates a new string by concatenating the reversed substrings of even indexes and odd indexes separa

tely from a given string.

Computers and Technology
1 answer:
salantis [7]3 years ago
8 0

Answer:

/ReversedEvenOddString.java

import java.util.Scanner;

public class ReversedEvenOddString {

   public static void main(String[] args) {

       Scanner sc = new Scanner(System.in);

       String s = sc.nextLine();

       String evens = "";

       String odds = "";

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

           if(i%2==1){

               odds += s.charAt(i);

           }

           else{

               evens += s.charAt(i);

           }

       }

       String res;

       if(s.length()%2==1){

           res = evens+odds;

       }

       else{

           res = odds+evens;

       }

       System.out.println(res);

   }

}

You might be interested in
What are two advantages of a pay-for-use online conferencing service compared to a free service? (Choose two)
tester [92]

Answer:

Provision of both audio and video

,dedicated support

Explanation:

Free services are not dedicated digital lines so there is no guarantee of high-quality sound or a reliable connection during the call. Some common issues  are background noises, crackling, echoes, distortion, quietness and drop-outs.Free services also don't offer dedicated support so if anything goes wrong there's nobody available to help you. Any of these problems can ruin the productivity and flow of your meeting.

5 0
3 years ago
Justice wrote a program and forgot to put the steps in the correct order. Which step does she need to review?
Lerok [7]

Answer:

Sequencing

Explanation:

5 0
2 years ago
Read 2 more answers
Try to crack the code:
ololo11 [35]

Answer:001101110010010100011011010110010011100100100000001100100100110001000010001101100100010100100000001101100100100001010001010101001101001010

Explanation:

i copied

3 0
2 years ago
Which is the best description of the laws governing IT professionals?
Vinvika [58]

Answer: D, Most laws are directed at the information, data, or intellectual property rather than the IT professional.

Explanation:i just took the test

4 0
3 years ago
-1
N76 [4]

Answer:A flowchart is a diagram that depicts the steps involved in solving a problem. The following flowchart shows how to output the multiplication table ( n * 1 to m * 1) of a number, n and m:

3 0
3 years ago
Other questions:
  • I plugged my phone up into a charger, the charger sparked and i unplugged my phone and now it wont charge at all, does anyone kn
    13·1 answer
  • Need Help !!! Please
    8·1 answer
  • In cell h15 enter a vlookup function to determine the 2018 percentage of total attendance for the city listed in cell h14. Use t
    7·1 answer
  • HELP ASAP U GET BRAINLIEST
    15·2 answers
  • Create an application named TurningDemo that creates instances of four classes: Page, Corner, Pancake, and Leaf. Create an inter
    7·1 answer
  • One key criterion for selecting social networks is the number of daily visitors to the website. when comparing linkedin traffic
    7·1 answer
  • Which tab on the Chart Tools Contextual tab will contain commands that are used to change the style of charts and to edit chart
    12·2 answers
  • 4
    12·2 answers
  • What was revolutionary about Web 2.0?
    5·1 answer
  • What is Utility Software ? Name any two utility programs. <br>​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!