Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java help please Write a program in Java that reads the user's name, age, and regular air fare. Calculate the final airfare depending on the

Java help please image text in transcribed
Write a program in Java that reads the user's name, age, and regular air fare. Calculate the final airfare depending on the age of the person: zero for 2 years or younger, 50% of the regular airfare for kids under 12 years and over 2 years, full regular price for ages 12-65 years, and 10% discount for ages 65 years or older. Output the name and age of the passenger, the discount amount, and the final airfare. Read the data from a text file. Name the file YourL astNameQuiz2 java. Here is an output example (do not worry about formatting as as the answers are correct): Name Fare Age Discount Rate Discount Discounted Smith $253.67 Brown $598.5 Mirza $444.9 Adams $800.0 Grow $965.75 43.0 100.0% 67.0 10.0% 10.0 50.0% 1.5 0.0% 31.0 100.0% $253.67 $59.85 $222.45 $0.0 $965.75 $0.0 $538.65 $222.45 $800.0 $0.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

Students also viewed these Databases questions