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 Layers in computer class 7. no scams please​
Bad White [126]

Answer:

This is your answer please check this ✔

7 0
2 years ago
Read 2 more answers
I WILL STAR YOU AND THANKS YOU!!!!!!!!!!!!!!!!
lord [1]
The answer seems to be polymerization.
 
8 0
3 years ago
PLEASE HURRY!!<br> Look at the image below
levacccp [35]
Answer is power and base

Explanation: both power and base are number variables
8 0
2 years ago
4. A friend knows you are taking a technology class in college and asks you how a hard drive works. In your own words, describe
natima [27]
In side the Hard drive there is a  <span> large shiny, circular "plate" of magnetic material called a </span>platter<span>, divided into billions of tiny areas called clusters. This Plate haves a pin over it that reads all the information that is on it. When this plate or pins damage thats when the hard drive need to be replace.   </span>
8 0
3 years ago
Which of the following statements accurately describes the early history of digital recording?
Alchen [17]
I would like to say that it was D. If I am not correct, try asking this in history.
6 0
3 years ago
Other questions:
  • Write a function decimalToBinaryRecursive that converts a decimal value to binary using recursion. This function takes a single
    11·1 answer
  • Namecoin is an alternative blockchain technology that is used to implement decentralized version of Routing Banking System.A. Tr
    14·1 answer
  • Write a program that asks the user to enter a number of seconds. There are 60 seconds in a minute. If the number of seconds ente
    9·1 answer
  • I am not a living being, I am a cylindrical shape that has three to eight sides. I never die. I can build anything again. What i
    5·1 answer
  • Why do you usually find domain names instead of IP addresses in a URL? Select one: a. An IP address would make your web page loa
    11·1 answer
  • Whats 12/29 divided by 12/34
    7·2 answers
  • To make changes to how UAC operates, you must be logged in as administrator true or false
    6·1 answer
  • Which of the following offers more reliable antivirus protection? Question 43 options: A) antivirus software on user PCs B) anti
    10·1 answer
  • What happens if part of an ftp message is not delivered to the destination?
    14·1 answer
  • Question 7 (1 point)
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!