From cryptic to crystal: Weather's facelift

Report a typo

Refactor the following poorly named variables in a weather application to follow Java naming conventions:

  1. int t = 25;

  2. int h = 60;

  3. int w = 6;

Print three lines with the refactored variable names and their values.

Sample Input 1:

25
60
6

Sample Output 1:

airTemperature = 25
airHumidity = 60
windSpeed = 6
Write a program in Java 25
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
int t = 25;
int h = 60;
int w = 6;

// TODO: Refactor variable names and print the results
}
}

Create a free account to access the full topic