Question: CPS 180 Lab Assignment #2 Points: 40 Assigned: 05/17/17 Due: 05/24/17 Part L (20 Points): Purpose: The purpose of this exercise is to become familiar

 CPS 180 Lab Assignment #2 Points: 40 Assigned: 05/17/17 Due: 05/24/17
Part L (20 Points): Purpose: The purpose of this exercise is to
become familiar with Java basic syntax, program structure, and problem solving. In

CPS 180 Lab Assignment #2 Points: 40 Assigned: 05/17/17 Due: 05/24/17 Part L (20 Points): Purpose: The purpose of this exercise is to become familiar with Java basic syntax, program structure, and problem solving. In addition, you should learn how to submit a program using the file submit capability of Blackboard. Exercise: Write a Java program that calculates the cost of gas for a road trip. Your program will need to collect the following pieces of information from the user. First name Miles per gallon (mpg) of the car Number of miles planned to drive Current price per gallon of gas After collecting the user's information and the performing the calculations your program should display the results in a format similar to: Sample Run user's inputs are shown in bold: Please enter your First Name: Ralph Please enter the MPG of your car: 20 160 Please enter the miles to be traveled: What is the price per gallon of gas: 2.00 Hello, Ralph! Thank you for providing your information! Car MPG 20 Miles to Drive: 160 Price per gallon of gas: $2.00 Your trip will cost: S16.00

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!