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
Answer:
use for loop when you know how much iteration user is going to perform.
if iteration is not confirmed and you want execute your loop atleast once use do while.
Answer:
The total const is 13025 KWh
Explanation:
These are the steps to solve this problem:
- Convert all the powers from W to KW dividing by 1000.
- Convert all the times on minutes to hours dividing by 60.
- Then you can apply energy consumption formula
for any of the appliances. the results will be at KWh. - Sum all the consumtions and you will have the total cost.
Attached you will have a spreadsheet as a guidance. Any questions, just let me know.
C: He forgot to save some certain materials in the PowerPoint.
Answer:
Explanation:
This java code creates a windowed java application that is 300x100 pixels large. The title of the program which is located in the bar at the top of the program starts off by saying "Come Closer". If you move the mouse over the program the program detects it. Then if you press the program it changes the title to "Let Go". If you press the program and immediately let go it changes the title to "Ouch" but if you hold for 1 or 2 seconds and let go it changes the title to "Whew". Finally, if you move the mouse cursor away from the program it changes the title back to "Come Closer"