Question: Must be coded in Java, with no If statements. only conditional statements allowed. Instructions Road Trip Budget: Write a utility program named Roadtrip that reads:
Must be coded in Java, with no If statements. only conditional statements allowed.
Instructions Road Trip Budget: Write a utility program named Roadtrip that reads: the mile-per-gallon rating of a car, the number of miles a trip will take the price of a gallon of gasoline in pennies the budget for a car trip (also in pennies) The program displays the dollars and cents cost of the trip on one line and then on the next line prints either "in budget" "over budget" depending on whether the cost was less than or equal to the budget (in budget) or greater than the budget (over budget) Sample output: $29.42 in budget Additional Notes: Regarding your code's standard output, CodeLab will check for case errors and will check whitespace (tabs, spaces, newlines) exactly Interactive Session ? Visible newlines Visible whitespace Display stdin Display stdout 30 60 400 1500 $8.00 in budget Submit Reset History: (No Submissions) RoadTrip.java
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
