Question: Write a method frequentFlier that accepts a Scanner for an input file of ticket type/mileage pairs and reports how many frequent-flier miles the person earned.

 Write a method frequentFlier that accepts a Scanner for an input

Write a method frequentFlier that accepts a Scanner for an input file of ticket type/mileage pairs and reports how many frequent-flier miles the person earned. 1 frequent flyer mile is earned for each mile traveled in coach. 2 frequent flyer miles are earned for each mile traveled in first class. 0 frequent flyer miles are earned on a discounted flight. For example, given the input below, your method should return 15600 (2*5000 + 1500+ 100 + 2*2000). firstclass 5000 coach 1500 coach 100 firstclass 2000 discount 300

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!