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
VLD [36.1K]
3 years ago
12

How to do assignment 5 on edhesive

Computers and Technology
1 answer:
s2008m [1.1K]3 years ago
6 0

Answer:

//To pass in a string, and pass in a pivot string, and at that moment print in obligatory sequence, the string after pivot string till last as first string, and published beforehand the left slice of string.

import java.util.Scanner;

public class Main {

public static void main(String args[]) {

  Scanner s2 = new Scanner(System.in);

  System.out.println("Enter the parent String:");

  String f2 = s2.nextLine();

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

  String piv1 = s2.nextLine();

  int start2 = f2.indexOf(piv1);

  int end2 = piv1.length()+start2;

  if (start2 == -1){

    System.out.println("Error: child string(Pivot) not discovered.");

    return;

}

String first2 = f2.substring(0,start2-1);

  String second2 = f2.substring(end2);

if (f2.charAt(start2-1)==' '){

System.out.println(second2 + " " + piv1 + " " + first2);

return;

}

System.out.println(second2 + piv1 + first2);

}

}

Explanation:

Please check the answer section.

You might be interested in
A hub transmits all incoming messages to all of its ports except the port where the messages came in. A switch usually sends mes
leonid [27]

Answer:

MAC Addresses (Destination and Source MAC address)

Explanation:

A switch has 3 primary functions:

  • Forward frames
  • Learn addresses
  • Avoid loops

An Ethernet frame has the header, data and trailer and there are two specific fields in the header that helps the switch to know where to send data in future transmissions.

  • destination MAC address
  • source MAC address

every Ethernet frame has this and when the frame hits a switch or any device, any device can look at it ( an Ethernet frame ) and know where it is suppose to go and where it came from.

Every switch has a MAC address table where it stores MAC addresses of different computers on the network.

Example:

When a PC1 sends a frame to PC2 through a switch, the switch looks at the header of the Ethernet frame for the source mac address and adds the source MAC address to its MAC address table and also the port that it came through.

simply put:

A switch looks at the source MAC address to see if it knows it already, if it does. Great! no need to add it again to it's address table.

If it doesn't, it adds it's source address and the port that the frame came from.

This basically how the switch populates its MAC address table.

3 0
3 years ago
Read 2 more answers
Physical activity such as sports or even a brisk walk can help reduce
ycow [4]
Physical activity could help reduce the chance ofheart disease
4 0
3 years ago
Read 2 more answers
The ______________________ is the part of the ip address that is the same among computers in a network segment.
kozerog [31]
The answer is 
External IP address.
4 0
3 years ago
The ___________________ command is used to establish connectivity.
schepotkina [342]
The PING command is used to establish connectivity
4 0
3 years ago
What does coding mean​
NeTakaya
The process or activity of writing computer programs.
3 0
3 years ago
Read 2 more answers
Other questions:
  • All of the following are incentives proprietary schools use to attract a student except
    7·2 answers
  • Approximately what percent of desktop PCs are used for work-related purposes?
    12·1 answer
  • The Earth's _______ is ductile overall, tending to flow very slowly and deform in a _______ manner.
    14·2 answers
  • Write an if else statement that assigns 0 to the variable b and assigns 1 to the variable c if the variable a is less than 10. O
    5·1 answer
  • The IT department sent out a memo stating that it will start delivering desktop computer interfaces through the IT data center v
    5·1 answer
  • What are the four common tags used on webpages?
    11·1 answer
  • This is for career exploration, I need help please! <3 HELPPPP
    8·2 answers
  • Any one know :) please
    9·1 answer
  • Give a brief explanation about the internet.plsssss
    7·1 answer
  • A Python file that contains variables and functions and can be used in other programs is called a
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!