3.d
5.c
8.a
9.b
10.b
just took the exam ... hope it helps
Answer:
public class Main
{
public static void main(String[] args) {
String[] strs = new String[10];
java.util.Scanner sc = new java.util.Scanner(System.in);
for(int i = 0; i < 10; i++){
System.out.print("Enter string " + (i+1) + ":");
strs[i] = sc.nextLine();
}
System.out.println("The strigs with even number of characters is");
for(int i = 0; i < strs.length;i++){
if(strs[i].length() % 2 == 0){
System.out.println(strs[i]);
}
}
}
}
Explanation:
Relational operators allow an end user to <u>compare</u> numbers.
<h3>What are
relational operators?</h3>
Relational operators can be defined as a programming language construct which allows an end user to compare both numbers and char values.
Also, it can be used to determine whether one number is less than (<), greater than (>), equal to (=), or not equal to another.
This ultimately implies that, relational operators allow an end user to <u>compare</u> numbers.
Read more on relational operators here: brainly.com/question/14995818
#SPJ1
Answer:
import java.util.Scanner;
public class num5 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Enter The First String");
String str1 = in.next();
System.out.println("Enter The Second String");
String str2 = in.next();
System.out.println("Enter The Third String");
String str3 = in.next();
String oneAndTwo = str1+str2;
if(str3.equals(oneAndTwo)){
System.out.println(str1+" + "+str2+" is equal to "+str3+"!");
}
else
System.out.println(str1+" + "+str2+" is not equal to "+str3+"!");
}
}
Explanation:
- Implemented in Using Java Programming Language
- Import Scanner Class to prompt and receive users' input
- Create three string variables and store the three values entered by the user (str1, str2 and str3)
- Concatenate str1 and str2 using the + operator and assign to a new variable
- Use the if statement with Java's .equals() method to check for equality of the new string with the third string
- Print the appropriate message if the equal or not