Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write a Java program to take the input for number of miles, and the class of journey (1,2, or 3, for first, second, and

image text in transcribed

1. Write a Java program to take the input for number of miles, and the class of journey (1,2, or 3, for first, second, and third class respectively), for a train journey. The program should then calculate and display the fare of journey based on the following criteria: First (1) Class Second (1) Class Third (3) Class First 100 mile $3 per mile $2 per mile Next 150 mile $ 2.50 per mile $ 1.50 per mile Remaining $2 per mile $1 per mile $1.50 per mile $1 per mile $0.50 per mile

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 101

Authors: Guy Kawasaki

1st Edition

0938151525, 978-0938151524

More Books

Students also viewed these Databases questions

Question

3. How would you address the problems that make up the situation?

Answered: 1 week ago

Question

2. What recommendations will you make to the city council?

Answered: 1 week ago