Write a program that asks for the speed of a vehicle

Assignment Help JAVA Programming
Reference no: EM13940744

The distance a vehicle travels can be calculated as follows:

Distance = Speed * Time

For example, if a train travels 40 miles-per-hour for three hours, the distance traveled is 120 miles.

Write a program that asks for the speed of a vehicle (in miles-per-hour) and the
number of hours it has traveled. It should use a loop to display the distance a vehicle has traveled for each hour of a time period specified by the user. For example, if a vehicle is
traveling at 40 mph for a three-hour time period, it should display a report similar to the one that follows:

Hour Distance Traveled
-----------------------------
1 40
2 80
3 120

Input Validation: Do not accept a negative number for speed and do not accept any value less than 1 for time traveled.

Reference no: EM13940744

Questions Cloud

Break-even chart to illustrate this solution : Each additional unit a company produces costs £45 to manufacture and it can sell each unit it produces for a fixed price of £72. The firm also has fixed costs of £8,100.
Show with a diagram the cash flows in this given deal : Show, with a diagram, the cash flows in this deal, assuming no Early Buyout Option. Would the deal make sense for DEF Leasing, assuming that its shareholders insist on a required return on equity of 15% p.a.
Steps in market research process : List the four steps in market research process? Describe in some detail the three types of research that are typically used in a business environment and any specify areas of research interest to business?
Determine for a rotational speed of 1000 rpm : Determine for a rotational speed of 1000 rpm (a) the radial force which each shoe exerts on the drum, (b) the torque transmitted, (c) the power transmitted
Write a program that asks for the speed of a vehicle : Write a program that asks for the speed of a vehicle (in miles-per-hour) and the number of hours it has traveled.
Rate of interest a credit card company charges : Which of the projects A and B below would be best according to (a) the NPV criterion, (b) the IRR criterion, if the market rate of interest is 6% per annum?
Historical scenario surrounding tyco international : Research is required to do the work. Briefly summarize the historical scenario surrounding Tyco International. • How do you think the spending and the loans were able to go on for so long?
Determine the speed at which the clutch starts to engage : Determine the speed at which the clutch starts to engage, the power transmitted at a speed of 1500 rpm.
Record acquisition of the building and the delivery truck : Record the acquisition of the building and the delivery truck. Compute and record the amortization expense on the patent for 2009 on a straightline basis.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Java threads

This is an introductory assignment on Java synchronization. You will use Java Threads while learning more about concurrency and achieving atomicity using Java’s inbuilt mechanisms.

  Elements of a column of a two-dimensional array

When processing all the elements of a column of a two-dimensional array, what possible runtime error do we have do worry about that the number of column elements may not be constant across all rows.

  Technical community blog

Write a blog article for a coding/technical community blog

  Web application that allows user to specify six lottery nums

Write a web application that allows a user to specify six lottery numbers. Generate your own combination on the server, and then print out both combinations together with a count of matches.

  Prepare a java program to random pick

The user and computer will each randomly pick one and common rules of winning apply. The game ends when the user and computer pick the same item.

  Prepare a demo program

Design, and implement a class that will be used in a program that simulates a combination lock. The lock has a circular knob with the numbers 0 through 39 marked on the edge, and it has a three-number combination, which we will call x,y,z.

  Write a java program that simulates a small cpu vm

Design and implement a program to simulate the operation of the SIMMAC based - dumps the contents of all registers and memory and then prints an "End of Job" message.

  Implementation of encryption and steganography in java

This is a project report showing the essential details and coding structures related with the implementation of encryption techniques and steganography in JAVA.

  Compare string values

Write a program that reads two strings from the keyboard and compares them and prints whether they are equal or not.

  Write java program to select pine for furniture company

Write down the Java program for the furniture company. Ask user to select P for Pine, O for Oak or M for Mahogany.

  Create a class called student

Java Create a class called Student that contains: - A field to store the name - A field to store their average numerical grade

  How can i support https in a servlet

1) What is SSL? 2) How can I support HTTPS (SSL) in a servlet? 3) How can I download a file (for instance, a Microsoft Word document) from a server using a servlet and an applet?

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