Question 1.
[Link]("I like Java.");
[Link]("You like tea.");
Question 2.
public class HelloWorld {
public static void main(String[] args) {
[Link]("Hello World!");
}
}
Question 3.
Valid: rate1, TimeLimit, numberOfWindows
Invalid: 1stPlayer, [Link], long
Question 4.
Yes, Java is case-sensitive.
Question 5.
int feet = 0, inches = 0;
Question 6.
interest = balance * rate;
Question 7.
Output:
b
c
c
Question 8.
(1/3) * 3 is equal to 0.0
Question 9.
Correct: fahrenheit = (9.0 / 5) * celsius + 32.0;
Question 10.
Output:
3
3
Question 11.
n == 3
Question 12.
double bmi = weight / (height * height);
Question 13.
Candy bars = coupons / 10; Gumballs = remaining / 3;
Question 14.
Use substring and toUpperCase for Pig Latin conversion.
Question 15.
Use constants, proper naming, and formatting.
Question 16.
weight = 110 + (extra inches * 5);
Question 17.
drinks = 10000 / caffeinePerDrink;
Question 18.
Use Scanner to input two numbers and print difference.
Question 19.
If age >= 18 → Eligible else Not eligible.