Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Returns 2 (AgeCalculator) [REQUIRED] They say that it's okay to date someone who is at least 1/2 your age + 7 years old. Write a

image text in transcribed
image text in transcribed
Returns 2 (AgeCalculator) [REQUIRED] They say that it's okay to date someone who is at least 1/2 your age + 7 years old. Write a method called ageCalculator, which takes an age as an int and returns the youngest age that someone of that age should date, as a double. For example, you should get the following output when you run the completed program. 16.5 23.0 56.5 Hint: if you're getting 16.0 and 56.0 instead of 16.5 and 56.5, think back to lab 2. What's the difference between int and double division? + Dating Calculator.java i public class DatingCalculator { 2 public static void main(String[] args) { 3 double x = ageCalculator (19); 4 double y = ageCalculator (32); 5 double z ageCalculator (99); 6 17 System.out.println(x); // prints 16.5 8 System.out.println(y); // prints 23.0 9 System.out.println(z); // prints 56.5 10 } 11 12 // Write the ageCalculator method here 13 in d w NN 14 15 }

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

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions