Identify the errors in this program This program prompts for the user\'s age and
ID: 3616235 • Letter: I
Question
Identify the errors in this programThis program prompts for the user's age and then attempts to workout the year in which the user was born
import java.util.*;
public class SomeProg
{
public static void main(String[]args)
{
Scanner sc= newScanner(Systeem.in)
final intYEAR;
int age,bornIn;
System.out.print(How old are you this year? );
age=sc.nextDouble();
bornIn=YEAR-age;
System.out.println("Ithink you were born in " + BornIn);
}
}
Explanation / Answer
please rate - thanks import java.util.*; public class SomeProg { public static void main(String[]args) { Scanner sc= newScanner(Systeem.in) spelling error ; missing final intYEAR; YEAR has no value int age,bornIn; System.out.print(How old are you this year? ); missing "" age=sc.nextDouble(); age is int not double bornIn=YEAR-age; System.out.println("Ithink you were born in " + BornIn); lower case bornIn } } code with above corrections import java.util.*; public class SomeProg { public static void main(String[] args) { Scanner sc=new Scanner(System.in); final intYEAR=2010; int age,bornIn; System.out.print("How old are you this year? " ); age=sc.nextInt(); bornIn=YEAR-age; System.out.println("Ithink you were born in " + bornIn); } }