Question: Are the specified lines of code good or bad uses of whitespace? import java.util.Scanner; public class WhitespaceGoodAndBad { public static void main ( String [

Are the specified lines of code good or bad uses of whitespace?
import java.util.Scanner;
public class WhitespaceGoodAndBad {
public static void main(String[] args){
Scanner scnr = new Scanner(System.in);
int userAge;
int currentDecade;
int nextDecade;
int nextMilestone;
System.out.println("Enter your age: ");
userAge = scnr.nextInt();
currentDecade=userAge/10;
nextDecade = currentDecade +1;
nextMilestone = nextDecade *10;
System.out.println("Next big birthday is at "+ nextMilestone);
}
}
1)
int nextDecade;
2)
currentDecade=userAge/10;
3)
nextDecade = currentDecade +1;
4)
nextMilestone = nextDecade *10;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!