Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

6. The cost of the training creates a need to show that it works.

Answered: 1 week ago