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]
4 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]4 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’s considered the brain of a computer?
Colt1911 [192]

Answer: The computer brain is a microprocessor called the central processing unit (CPU).

Explanation:

The CPU is a chip containing millions of tiny transistors. It's the CPU's job to perform the calculations necessary to make the computer work -- the transistors in the CPU manipulate the data.

5 0
4 years ago
Read 2 more answers
A _____ is a set of standards, development tools, and software libraries that help programmers develop software solutions faster
fgiga [73]

Answer:

framework

Explanation:

Q:

A _____ is a set of standards, development tools, and software libraries that help programmers develop software solutions faster and with more consistency.

A:

b. framework

7 0
2 years ago
define and discuss the following network protocols: TCP, UDP, IP, and ICMP. Include the differences between TCP & UDP and IP
Vanyuwa [196]

Answer:

 The following types of network protocols are explained below as:

TCP:  TCP stand for the transmission control protocol and it is used for the interconnect various types of network devices on internet. The TCP is the type of protocol that is used for communication in the particular private network and it is also known as intranet.  

UDP: UDP stand for the use data gram protocol and it is the simplest and the connection less protocol. On the other hand, TCP is the connection oriented internet protocol. By using the UDP, we can easily sent multiple message in the form of packets.

IP: IP stand for the Internet protocol and it is used as the internet address protocol for assigning the connection between the each device in the network. The main function of the IP is that it used for locating the address in the system.  

ICMP: ICMP stand for the internet control message protocol and it is the main integral part of the IP. The ICMP is the error detecting internet protocol in the network devices. It is one of the important networking security in the system.

6 0
3 years ago
Why is digital data, at the base level in computers, represented in binary? * 10 points 0's and 1's are the easiest numbers to d
Liula [17]

Answer:

The representation of the digital data in the computer system in the binary form because it is easier and cheaper to use in the system. It is more reliable to build the machine and the devices for distinguish the binary states.  

Computer basically uses the 0 and 1 binary digits for storing the data in the system. The computer processor circuits are basically made up of the various types of transistors that uses electronic signals for the activation process in the system.

The o and 1 are the binary digits that reflect the different states of the transistor that is OFF and ON state.

8 0
3 years ago
Which of the following are movements which can be applied to objects in a presentation?
Svetlanka [38]

Answer:

Slide transitions

Explanation:

It is a movement of slides from one slide to the next

3 0
3 years ago
Other questions:
  • What is the only real language a computer understands?
    8·1 answer
  • What is value parameter and reference parameter while things are passed by Also, do a c code to show it
    13·1 answer
  • Select the correct answer.
    13·1 answer
  • __________ is the backbone of a computer, connecting all of its components including the central processing unit (CPU) and prima
    5·1 answer
  • What symbol do we use to denote a character?
    9·2 answers
  • Which of the following functions needed to implement the information security program evaluates patches used to close software v
    5·1 answer
  • Drag the tiles to the correct boxes to complete the pairs.
    15·2 answers
  • David is taking a test. To answer a question, he first covers up the answer choices. Next, he tries to answer the question. Then
    15·2 answers
  • What's this little?<br>​
    9·1 answer
  • Select the functions in the Insert tab in PowerPoint.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!