Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Estimate the amount of time a person has slept in their life (roughly). Write a Java application that will input a person's name, age, and

image text in transcribed

Estimate the amount of time a person has slept in their life (roughly). Write a Java application that will input a person's name, age, and a typical number of hours he/she sleeps per night. Valid input could be: Joe Smith 28 7.5 From that data, calculate: 1. The number of hours the person has slept during his/her life o age * 365 * hours slept each night 2. The number of days the person has slept during his/her life o Answer from #1 divided by 24 3. The number of years the person has slept during his/her life o Answer from #2 divided by 365 NOTE: You are estimating the values above. For example, your age is based upon your last birthday. Do not worry about days since a person's last birthday. For this assignment: Use text field objects for input areas. Use label objects as headings and labels which describe an adjacent text field. Use label objects for output areas (one for each of the three items above). Use buttons to perform actions (like calculate, exit, etc.). Your panel will include two button objects: 1. Calculate - This button will take the input from the text fields objects, convert the input to numeric values and store in variables, calculate the total hours, days, and years slept, and display the results in label objects (3) in the panel. 2. Exit - This button will close the application. You can use Platform.exit(); and System.exit(0)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

When are the parties to an illegal agreement in pari delicto?

Answered: 1 week ago

Question

fscanf retums a special value EOF that stands for...

Answered: 1 week ago