How many gallons the cars gas tank holds

Assignment Help JAVA Programming
Reference no: EM131663725

Programming Project

Submission Instructions

Open Eclipse and create a Java Project called Project1. Add a class named RoadTrip to this project.

At the top of your file, enter a comment with your name, the assignment number, the date, and a short description of what the program does. For example, if I were submitting the assignment my comment might look like this:

/**
* Author: Susanne Sherba
* Programming Project 1
* October 2, 2016
* Calculates gallons of gas needed and number of stops for a road trip.
*/

When you are finished, export your project from Eclipse and upload it to Canvas before the due date. To do this, right click on the project name and select Export. Select General->Archive File and click Next. Select the project you wish to export (Project1 in this case) and click Browse to browse to a location to save your file.

Assignment

You and your friends are planning a road trip. Write a program that asks the user for information about where they are going and the car they are driving and then gives them some helpful information about their trip. Specifically, you should ask the user for:

• the name of the city they are leaving from
• the name of the city they are going to
• the distance between the two cities
• how many miles per gallon their car gets
• how many gallons the car's gas tank holds

You should output the name of the starting and ending cities, the number of gallons of gas the trip requires (with one decimal place) and the number of stops you will need to make along the way (as an integer). Make sure the city names are capitalized, even if the user didn't capitalize them. You may assume that your gas tank is full at the beginning of the trip.

Here's a sample interaction with the user:

Enter city you are leaving from: denver
Enter city you are driving to: jacksonville
Enter distance in miles: 1748
Enter miles per gallon your car gets: 34
Enter the number of gallons your car's tank holds: 15.3

Your trip from Denver to Jacksonville will require 51.4 gallons of gas.

Assuming your gas tank is full when you leave, you will need to stop to fill up 2-3 times.

Reference no: EM131663725

Questions Cloud

Purpose and value to using arrays : Describe the purpose and value to using arrays and functions in C++ programming.
Differentiate gross margin and contribution margin : Gross margin and contribution margin. The Museum of America is preparing for its annual appreciation dinner for contributing members.
Unique category of computer problems : Consider the following statement: "Network problems are not really a unique category of computer problems; all network problems are basically either hardware
What will be the average time waiting in the system : What will be the average time waiting in the system? What will be the average time in the system.
How many gallons the cars gas tank holds : Write a program that asks user for information about where they are going. How many miles per gallon their car gets? How many gallons the car's gas tank holds?
Unix or linux for operating systems : Briefly, explain why corporations are increasingly interested in using Unix or Linux for their operating systems? one to two paragraph
Is the cost of the ehr worth the effort and struggle : Is the cost of the EHR worth the effort and struggle?
Summary be a part of the research paper : It does not clearly state it, but can the executive summary be a part of the research paper or should it be its own document?
Several file servers with multiple shared folders : You work for a corporation that has several file servers with multiple shared folders. You want to make it easier for users to access the shared folders.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd