private static String removeFromString(String old, String frag)
{
int i = old.indexOf(frag);
while (i> -1) {
String rest = old.substring(i + frag.length());
System.out.println("rest = " + rest);
old = old.substring(0, i);
System.out.println("rest = " + old);
old = old + rest;
System.out.println("rest = " + old);
i = old.indexOf(frag);
System.out.println("i = "+ i);
}
return old;
}
Here the index of first occurrence is obtained outside the “while loop” and if this loop runs until index value is >-1. It extracts the rest of the characters other than “frag” from the index and all the characters for which the given set of characters are removed.
"force per unit area" because pressure is force per unit area.
hope this helped
Answer: The amount of interest to be paid is $972
Explanation: This is gotten by firstly getting the amount of money to return per year without the interest which is $114400/10(years)= 11440
11440 is to be paid per year without interest. To get amount of interest is $11440*8.5/100 = $972 this is the amount of interest to be paid per year including in year 2.
Therefore, total amount of money together with interest to be paid each year and in year 2 = $11440+$972=12412.
3. 8.1
Looking at the functions "average", and "mystery" it's pretty obvious that "average" returns a double precision average of the value of an integer array. The function "mystery" returns an array of integers with each value in the array being the length of the string in the array of strings passed to "mystery" in the same ordinal position.
The main body of the code initializes an array of strings and then passes that array to "mystery" who's output is then passed into the function "average". Since the lengths of the words passed to "mystery" is 7, 5, 6, 10, 10, 8, 13, 6, 8, 8, the sum will be 81, so the average will be 81/10 = 8.1 which matches option "3".
Server and network is 2 different things, just put the server on a different network. ;) duh
Explanation: