Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Done in Visual Studio for Visual Basic 2. Distance Calculator If you know a vehicle's speed and the amount of time it has traveled, you

Done in Visual Studio for Visual Basic

image text in transcribedimage text in transcribed

image text in transcribed

2. Distance Calculator If you know a vehicle's speed and the amount of time it has traveled, you can calculate the distance it has traveled as follows: Dis tan ce Speed *Time For example, if a train travels 40 miles per hour for 3 hours, the distance traveled is 120 miles. Create an application with a form similar to the one shown in Figure 5-47D When the user clicks the Calculate button, the application should display an input box asking the user for the speed of the vehicle in miles-per-hour, followed by another input box asking for the amount of time, in hours, that the vehicle has traveled. Then it should use a loop to display in a list box the distance the vehicle has traveled for each hour of that time period. Figure 5-48 shows an example of what the application's form should look like. Figure 5-47 Distance Calculator Distance Calculator Calculate Exd Figure 5-48 Distance Calculator completed Distance Calculator Vehicle Speed: 40 MPH Time Traveled: 7 hours Hours Distance Traveled 40 80 120 160 200 240 280 Total Distance: 280 Calculate Exit Use the following test data to determine if the application is calculating properly. Vehicle Speed: 60 Hours Traveled: 7 Hours Distance Traveled 60 120 180 240 300 360 420

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: 3

blur-text-image

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

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions