Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

draw aflowchart loop Scanner scanner = new Scanner(System.in); double before500 = 0.70; double after500 = 0.50; int StaffNo = 20; for (int i = 1;

draw aflowchart loop

Scanner scanner = new Scanner(System.in); double before500 = 0.70; double after500 = 0.50; int StaffNo = 20;

for (int i = 1; i <= StaffNo; i++) { System.out.print("Enter the distance of the trip staff " + i + ": "); double distance = scanner.nextDouble(); double totalClaim = 0;

if (distance <= 500) { totalClaim = distance * before500; } else { totalClaim = (500 * before500) + ((distance - 500) *after500); }

System.out.println(" The Total mileage claim for staff " + i + ": RM" + totalClaim); } } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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