I believe this would be C, B, A, D
Sorry if it wasn’t.
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!
<span>ExpressCard modules and USB adapters are faster and smaller. They are easier to plug into a computer and allow a person to add memory, wired and wireless communications, multimedia, and security features by inserting the small card or adapter into a small slot in the computer.</span>
Answer:
Miguel y Maru están muy cansados. - Miguel y Maru están cansadísimos
Felipe es muy joven. - Felipe es jovencísimo
Jimena es muy inteligente. - Jimena es inteligentísima
La madre de Marissa está muy contenta. - La madre de Marissa está contentísima
Estoy muy aburrido. - Estoy aburridísimo
Explanation:
In this activity we have to switch the statements to the absolute superlative of the expressions. In Spanish we can add the suffix -ísimo to an adjective to refer to the highest degree of something. It can be translated in ENglish to "really, extremely, super or quie". The statements in English are:
- Miguel and Maru are very tired - Miguel and Mary are extremely tired
- Felipe is very young - Felipe is super young
- Jimena is very smart - Jimena is really smart
- Marissa´s mother is very happy - Marissa´s mother is extremely happy
- I´m very bored - I´m super bored
Answer:
Written in Java
public static void printArray(int myarr[], String s){
for(int i = 0; i<myarr.length;i++){
System.out.print(myarr[i]+s);
}
}
Explanation:
This defines the static method alongside the array and the string variable
public static void printArray(int myarr[], String s){
The following iteration iterates through the elements of the array
for(int i = 0; i<myarr.length;i++){
This line prints each element of the array followed by the string literal
System.out.print(myarr[i]+s);
}
}
The method can be called from main using:
<em>printArray(myarr,s);</em>
Where myarr and s are local variables of the main