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
IgorC [24]
3 years ago
10

Given the strings s1 and s2 that are of the same length, create a new string consisting of the last character of s1 followed by

the last character of s2, followed by the second to last character of s1, followed by the second to last character of s2, and so on (in other words the new string should consist of alternating characters of the reverse of s1 and s2). For example, if s1 contained hello" and s2 contained "world", then the new string should contain "odlllreohw". Assign the new string to the variable s3.
Computers and Technology
1 answer:
Free_Kalibri [48]3 years ago
7 0

Answer:

See the code snippet in the explanation section

Explanation:

import java.util.Scanner;

public class Question {

   public static void main(String args[]) {

              Scanner scan = new Scanner(System.in);

 System.out.println("Enter first string: ");

 String s1 = scan.nextLine();

 System.out.println("Enter second string: ");

 String s2 = scan.nextLine();

 concatenateString(s1, s2);

 }

 

 public static void concatenateString(String firstString, String secondString){

 int stringLength = firstString.length() - 1;

 String s3 = "";

  if (firstString.length() != secondString.length()){

  System.out.println("String do not have equal length");

 } else {

  for(int i = stringLength; i >= 0; i--){

   s3 += String.valueOf(firstString.charAt(i)).concat(String.valueOf(secondString.charAt(i)));

  }  

  System.out.println(s3);

 }

   }

}

You might be interested in
Complete the sentence about entering and editing data in a cell in a spreadsheet.
likoan [24]

Answer:

1. Emphasize important data elements

2. Easier to understand

Explanation:

Two reasons for which you might format data in a spreadsheet is to <u>emphasize important data elements</u> and make data <u>easier to understand</u>.

Data simply means information which in this case is in numerical form. The sole aim of gathering data is to make sense of it and make sure your message is passed across.

So, it is important for emphasis to be placed on important data elements so as to make the data easier to understand.

4 0
3 years ago
What are the impacts of mobile phone?as well as the positive and negative impacts?​
Pepsi [2]

The positive impact are :

It can work for a long time.

It can solve millions of calculations in a few seconds and save huge amount of data.

It helps to know about technology and other things.

It can be carry from one place to another place.

The negative impacts are :

It may creates health and unemployment problems.

It is useless without electricity.

It have no self thinking power.

It required a trained person to do work

5 0
3 years ago
Amy just added a 462 meter run of fiber optic cable to the network what should she do next?
andriy [413]

Answer:

test it.

Explanation:

Based on the information provided within the question it can be said that the next logical step after installing the 462 meter run of cable would be to test it. This is done in order to make sure that there were no malfunctions during installation and that everything is running through the cable correctly. To test the cable you must perform an end-to-end attenuation test which will verify the quality of the installation as well as ensure high quality system performance.

6 0
3 years ago
You can find synonyms and disciplinary jargon in the ______, _______, and ______ in your search results. You can then use these
Slav-nsk [51]

Answer:

1. Title

2. Abstract

3. Subject Headings

Explanation:

To carry out a project or research survey, a researcher needs an appropriate title that satisfies the technical keywords relating to the content and expected outcome of the research.

Hence, in this case, to find an appropriate title for a research survey "You can find synonyms and disciplinary jargon in the TITLE, ABSTRACT, and SUBJECT HEADINGS in your search results. you can then use these as keywords in additional searches."

7 0
3 years ago
________ is a computer-based network that triggers actions by sensing changes in the real or digital world.
Evgesh-ka [11]

Answer:

Smart system

Explanation:

Smart System is a computer-based network that triggers actions by sensing changes in the real or digital world.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Why is driving a privilege?
    15·2 answers
  • True or false: although the first personal computers were available as early as the 1970's, the creation of the world wide web (
    11·1 answer
  • The term ________ refers to the use of a single unifying device that handles media, Internet, entertainment, and telephone needs
    7·1 answer
  • Assume that there is a class called BankAccountHolder that represents an individual member of a bank. There is also a BankAccoun
    5·2 answers
  • The M:N relationship between STUDENT and CLASS must be divided into two 1:M relationships through the use of the ENROLL entity;
    10·2 answers
  • A _________________________ can use SOAP headers to carry meta information in its messages. A. Web service B. REST Service C. Co
    14·1 answer
  • Technologies can offer safety and protection for people
    11·1 answer
  • Complete the statement using the correct term.
    10·1 answer
  • how risk can impact each of the seven domains of a typical IT infrastructure: User, Workstation, Local Area Network (LAN), Local
    7·1 answer
  • What is a port?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!