Answer:
- public static String bothStart(String text1, String text2){
- String s = "";
-
- if(text1.length() > text2.length()) {
- for (int i = 0; i < text2.length(); i++) {
- if (text1.charAt(i) == text2.charAt(i)) {
- s += text1.charAt(i);
- }else{
- break;
- }
- }
- return s;
- }else{
- for (int i = 0; i < text1.length(); i++) {
- if (text1.charAt(i) == text2.charAt(i)) {
- s += text1.charAt(i);
- }else{
- break;
- }
- }
- return s;
- }
- }
Explanation:
Let's start with creating a static method <em>bothStart()</em> with two String type parameters, <em>text1 </em>&<em> text2</em> (Line 1).
<em />
Create a String type variable, <em>s,</em> which will hold the value of the longest substring that both inputs start with the same character (Line 2).
There are two possible situation here: either <em>text1 </em>longer than<em> text2 </em>or vice versa. Hence, we need to create if-else statements to handle these two position conditions (Line 4 & Line 13).
If the length of<em> text1</em> is longer than <em>text2</em>, the for-loop should only traverse both of strings up to the length of the <em>text2 </em>(Line 5). Within the for-loop, we can use<em> charAt()</em> method to extract individual character from the<em> text1</em> & <em>text2 </em>and compare with each other (Line 15). If they are matched, the character should be joined with the string s (Line 16). If not, break the loop.
The program logic from (Line 14 - 20) is similar to the code segment above (Line 4 -12) except for-loop traverse up to the length of <em>text1 .</em>
<em />
At the end, return the s as output (Line 21).
Answer:
The complete code is as follows:
from array import *
myArr = array('f',[3, 5, 7,3, 10])
location = myArr.index(7)
print(str("7")+" is at position "+str(location+1))
Explanation:
I made corrections to the third line of the code and I added a line
This line gets the index of 7 from the array myArr using the index keyword
location = myArr.index(7)
This line prints the position of the 7 in the array
print(str("7")+" is at position "+str(location+1))
Because some of the heat produced by a condensing oil furnace is latent heat, it functions more efficiently.
<h3>Is the capacity of an oil furnace expressed in input or output?</h3>
The steady-state heat output of the furnace, expressed in BTU/h, is known as the heating (bonnet) capacity of oil heating appliances. Today's typical oil-fired central heating units for residential use have heating capacity ranging from 56,000 to 150,000 BTU/h.
<h3>What unit of heat is the capacity of an oil furnace stated in?</h3>
The amount of heat (Btu per gallon) released during the combustion process, in which the oxygen from the air combines with the hydrogen and carbon in the fuel, is how a fuel oil's heat of combustion value is expressed.
To learn more about condensing oil furnace and heating (bonnet) capacity, Visit:
<u>brainly.com/question/14783076</u>
#SPJ4
Answer: Aluminum, tin, and copper
Explanation: Optically stimulated luminescence (OSL) is a method in which the ionizing radiation help in measuring of the doses. It has working dependent on the radioactivities which are present in the sediments.
The filters that are used for detection of the OSL is usually made of aluminium , copper or tin because the can easily detect isotopes in the sediments which is cause by minerals like uranium etc.