CS142 Coding Exercise 4 Purpose: The purpose of this coding exercise is for you to gain experience using the switch cons

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

CS142 Coding Exercise 4 Purpose: The purpose of this coding exercise is for you to gain experience using the switch cons

Post by answerhappygod »

CS142 Coding Exercise 4
Purpose: The purpose of this coding exercise isfor you to gain experience using the switchconstruct in Java.
Company 1 will pay the trucker $PAY totransport the cargo DISTANCE.
Company 2 will pay the trucker $PAY totransport the cargo DISTANCE.
Company 3 will pay the trucker $PAY totransport the cargo DISTANCE.
The trucker will get the most moneyfrom Company X.
Of course, here PAY should getreplaced with the actual pay, DISTANCE with the actual distance,and X with the appropriate company number.
Some Test Cases: To help you with your coding,here are some sample outputs from public static doubletruckerPay(int shipper, double miles).
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply