import java.util.Scanner;
public class U2_L3_Activity_Four {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter a sentence.");
String sent = scan.nextLine();
int count = 0;
for (int i = 0; i < sent.length(); i++){
char c = sent.charAt(i);
if (c != ' '){
count++;
}
else{
break;
}
}
System.out.println("The first word is " + count +" letters long");
}
}
We check to see when the first space occurs in our string and we add one to our count variable for every letter before that. I hope this helps!
Answer: This is a python code
def lightyear():
rate=3*100000000 //speed of light
seconds=365*24*60*60 //number of seconds in 1 year
return str((rate*seconds)/1000)+" km" //distance=speed x time
print(lightyear()) //will print value of light hear in kilometers
OUTPUT :
9460800000000.0 km
Explanation:
In the above code, there is a variable rate, which stores the speed of light, i.e. distance traveled by light in 1 second which is in meters. Another variable is seconds, which store the number of seconds in 1 year, which is no of days in 1 year multiplied by the number of hours in a day multiplied by the number of minutes in an hour multiplied by the number of seconds in a minute. Finally, distance is speed multiplied by time, so distance is printed in kilometers and to convert distance in kilometers it is divided by 1000.
Answer:
Groove
Explanation:
There is not much to explain
To develop the system of multimedia we use the various hardware/softwarecomponents are:
The CPU: The CPU, which
is recommended for a multimedia computer should be Pentium IV or other advanced chips. The Monitor: The multimedia PC should be equipped with a monitorhaving Super
Video Graphics Arrays (SVGA) card.
Mark me as brainliest please