Course Solutions Uncategorized (Solved) : Hi Following Code Executes Nothing Want Execute H E L L L O T H E R E Public Class Tag Pub Q34451451 . . . .

(Solved) : Hi Following Code Executes Nothing Want Execute H E L L L O T H E R E Public Class Tag Pub Q34451451 . . . .

 

Hi the following code executes nothing but I want it to execute”H#e#l#l#l#o# t#h#e#r#e#!#”:

public class tag{
public static void main(String[]args){

String s = “Hello there!”;
String s2 = “”;
int index=0;
for(int x=0; x<10;x++){
if(s.indexOf(index) != -1){
s2 = s2 + s.charAt(x) + “#”;
index++;
}
else if (x > s.length()){
System.out.print(“x”);
}
}
System.out.println(s2);
}
}

Expert Answer


An answer will be send to you shortly. . . . .

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Answered) : Problem 5 Sa Following Tasks Complete Ev Sv Cv Cpi Spl Etc Eac Show Work Al Costs S000 O T Q32396398(Answered) : Problem 5 Sa Following Tasks Complete Ev Sv Cv Cpi Spl Etc Eac Show Work Al Costs S000 O T Q32396398

<br/><img src="https://media.cheggcdn.com/media%2Ff1e%2Ff1e2d133-f54d-4df1-87c8-8cadfe6f14ed%2Fimage.png" alt="Problem 5 Sa.For the following tasks, complete EV, SV, CV, CPI, SPL, ETC and EAC. Show your work. Al costs in S000, o time in days. %Completion is