Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

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.

Java, Programming

  • Category:- Java
  • Reference No.:- M92472427
  • Price:- $35

Priced at Now at $35, Verified Solution

Have any Question?


Related Questions in Java

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Part a specification - robot simulationpart a

PART A Specification - Robot Simulation PART A Requirements To complete this assignment you will use the supplied eclipse project Robot P1/. It is already set up to execute a simple arm movement loop which you will build ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Object-oriented software development1 introduction 11

OBJECT-ORIENTED SOFTWARE DEVELOPMENT 1. Introduction 1.1 Assignment Requirement 1.2 Deliverables and Structure (what to submit) 1.3 Software Restrictions 1.4 How to score high... 1.5 Assumptions 2. System Requirements 2. ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

Operating systems assignment -problem 1 sharing the bridgea

Operating Systems Assignment - Problem 1: Sharing the Bridge A new single lane bridge is constructed to connect the North Island of New Zealand to the South Island of New Zealand. Farmers from each island use the bridge ...

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As