Prompt the user for the year they were born// b. Declare a constant for the current year.// c. Calculate and print the age the user will be this year.// d. Declare a constant for average life expectancy,// set its value to 78.94// e. Calculate and print the percentage of the user's// expected life they've lived. Use the DecimalFormat// class to format the percentage to one decimal place.// Your code goes here Its quiet diffucult what to start with?

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 1CP
icon
Related questions
Question

Prompt the user for the year they were born
// b. Declare a constant for the current year.
// c. Calculate and print the age the user will be this year.
// d. Declare a constant for average life expectancy,
// set its value to 78.94
// e. Calculate and print the percentage of the user's
// expected life they've lived. Use the DecimalFormat
// class to format the percentage to one decimal place.
// Your code goes here

Its quiet diffucult what to start with?

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 2 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT