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
Slav-nsk [51]
4 years ago
6

How to do assignment 5 on edhesive please help

Computers and Technology
1 answer:
Shalnov [3]4 years ago
8 0

Answer:

//To enter a string, and enter a pivot string, and then print in required sequence, the string from pivot string to last as first string, and printed before the left portion of string.

import java.util.Scanner;

public class Main {

 public static void main(String args[]) {

   Scanner s1 = new Scanner(System.in);

   System.out.println("Enter Main String:");

   String f1 = s1.nextLine();

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

   String piv = s1.nextLine();

   int start1 = f1.indexOf(piv);

   int end1 = piv.length()+start1;

   if (start1 == -1){

     System.out.println("Error: Sub string(Pivot) cannot be found.");

     return;

   }

   String first1 = f1.substring(0,start1-1);

   String second1 = f1.substring(end1);

   if (f1.charAt(start1-1)==' '){

     System.out.println(second1 + " " + piv + " " + first1);

     return;

   }

   System.out.println(second1 + piv + first1);

   

 }

}

Explanation:

Please check the answer section

You might be interested in
I WILL GIVE BRAINLIEST TO WHO ANSWERS FIRST AND CORRECTLY.
svlad2 [7]

Answer:

The answer is false

Explanation:

Please give me brainliest so I can post my artwork

6 0
4 years ago
Assume x represents an integer number, what is the highest index value in the following array? byte[] values = new byte[x]; Grou
scoundrel [369]

Answer:

You forgot to add a group of choices, however assuming this programming language uses 0-based indexes the answer would be x - 1

Explanation:

Zero based index languages have array indexes starting at 0. When you create that array, you use x to define the amount of elements, however due to the array starting at the index 0, the arrays highest index would be x - 1 instead of x.

4 0
2 years ago
When reading words using a Scanner object's next method, _________. a. any characters at the beginning of the input that are con
zavuch27 [327]

Answer:

The answer is "Option d"

Explanation:

The scanner method is the full token of the process, that finds and returns. It is token, which is followed by both the inputs meeting and the guideline template. This method can block, even though the former instance of hasNext() is true while waiting for input, and wrong choices can be described as follows:

  • In option a, It is incorrect because the character at the beginning can't be considered.
  • In option b, It is wrong because the characters are known as the word in which blank space not a part of the word.
  • In option c, It is wrong because in this input before the call is not the method.
3 0
3 years ago
What does tiny ink link do?????
patriot [66]

Answer:

what is it

Explanation:

'tiny ink link'

8 0
3 years ago
Read 2 more answers
Digital data is _____ and analog information is _____.
Liula [17]
Digital data is discrete and analog information is continuous.
6 0
4 years ago
Other questions:
  • Which signal types are represented by a continuous wave form?
    11·1 answer
  • ________ reality is the addition of digital information directly into our reality, either to add more detail or to remove unwant
    7·1 answer
  • o maintain reasonable key security (mark all that apply): Ensure that someone else always has an extra key. Ensure that no extra
    10·1 answer
  • A cell has an unlimited number of conditions for Conditional Formatting.<br> A.true<br> B.false
    7·1 answer
  • Joe a frequent visitor to a branch office attempts to connect his tablet to the office wireless network but is unable to connect
    14·1 answer
  • A___ is a placeholder where you can enter text to manipulate and give new graphical effects.​
    13·1 answer
  • Select the best answer from the drop-down menu. Sometimes people feel threatened by new ideas and different ways of doing things
    5·1 answer
  • Complete the sentence. Use a ___ ___ (2 words) to find a website's URL based on keywords you specify.​
    15·1 answer
  • What is computer virus?​
    12·1 answer
  • What is a computer? ​
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!