Answer:
See explaination
Explanation:
import java.util.Scanner;
public class Word
{
public static void main(String args[])
{
Scanner read=new Scanner(System.in);
char repeat='Y';
String phrase=null;
int index=0;
while(repeat=='Y')
{
System.out.println("enter a phrase :");
phrase=read.nextLine();
while(index<=0)
{
System.out.println("enter an index greater than 0");
index=Integer.parseInt(read.nextLine());
}
String s;
int spaces = phrase == null ? 0 : phrase.length() - phrase.replace(" ", "").length();
int numofwords=spaces+1;
if(index>numofwords)
{
index=numofwords;
}
System.out.println("word is: "+ getWord(phrase,index));
System.out.println("do you want to repeat (Y/N)");
repeat=read.nextLine().charAt(0);
index=0;
}
read.close();
}
private static String getWord(String phrase, int index) {
// TODO Auto-generated method stub
Scanner in =new Scanner(phrase);
String word=null;
int wordindex=0;
while(wordindex!=index)
{
word=in.next();
wordindex++;
}
in.close();
return word;
}
}
Check attachment screenshot
That you have to multiply first and then divide
Part 1926 & Part 1910
hope this helps
Answer:
def funct1():
h=int(input("Enter height of the box"))
w=int(input("Enter the width of the box"))
L=int(input("Enter the length of the box"))
surface_area=2*(h*w + h*L + w*L)
return surface_area
a=funct1()
print(a)
Explanation:
Please check the answer section.
Answer:
22.5 s is the correct answer to the given question .
Explanation:
Given that
For light:
We know that speed of light c
We know that

For thunder :
Speed of sound ,v=332 m/s

Therefore the difference between time is given as follows

22.5 is the answer