Given a person’s year of birth, the Birthday Wizard can compute the year in which the person’s nth birthday will occur or has occurred. Write statements that can be used in a Java program to perform this computation for the Birthday Wizard.

What will be an ideal response?


```
System.out.println("Greetings.");

int year, age;

Scanner keyboard = new Scanner(System.in);
System.out.println("What year were you born in?");
year = keyboard.nextInt();
System.out.println("Choose an age in years.");
age = keyboard.nextInt();

System.out.println("You will turn " + age + " in the year ");
System.out.println(year + age);

```

Computer Science & Information Technology

You might also like to view...

If you want a loop to quit iterating if x < 10 and y > 3, what would be the proper loop condition test?

a. (x < 10 && y > 3) b. (x >10 || y < 3) c. (x >=10 && y <=3) d. (x >=10 || y <=3)

Computer Science & Information Technology

Which of the following is NOT part of a wireless MAC frame?

A. 802.11 protocol version B. source MAC address C. FCS D. TTL

Computer Science & Information Technology

The Office Clipboard can hold up to ________ items

Fill in the blank(s) with correct word

Computer Science & Information Technology

The ____ method is useful in debugging a program because it can be used to display and examine values.

A. finalize() B. toString() C. notify() D. equals()

Computer Science & Information Technology