Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started