Assuming there are no accidents or delays, the distance that a car travels down the interstate can be calculated with the following formula:
Distance = Speed × Time
Create a VB application that allows the user to enter a car’s speed in miles-per-hour. If the user fails to enter numeric values, display an appropriate error message and do not attempt to perform calculations. When a button is clicked, the application should display the following:
- The distance the car will travel in 5 hours
- The distance the car will travel in 8 hours
- The distance the car will travel in 12 hours
Want to see the full answer?
Check out a sample textbook solutionChapter 3 Solutions
Starting Out With Visual Basic (7th Edition)
Additional Engineering Textbook Solutions
Problem Solving with C++ (10th Edition)
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Introduction to Programming Using Visual Basic (10th Edition)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Starting Out with Python (4th Edition)
Problem Solving with C++ (9th Edition)
- Account numbers sometimes contain a check digit that is the result of a mathematical calculation. The inclusion of the digit in an account number helps ascertain whether the number is a valid one. Write an application named CheckDigit that asks a user to enter a four-digit account number and determines whether it is a valid number. The number is valid if the fourth digit is the remainder when the number represented by the first three digits of the four-digit number is divided by 7. For example, 7770 is valid, because 0 is the remainder when 777 is divided by 7. The next problems rely on the generation of a random number. You can create a random number that is at least mi n but less than max using the following statements: Random ranNumberCenerator = new Random(); int randomNumber; randomNumber = ranNumberGenerator .Next(min, max);arrow_forwardFor each of the following exercises, you may choose to write a console-based or GUI application, or both. Write a program for The Carefree Resort named ResortPrices that prompts the user to enter the number of days for a resort stay. Then display the price per night and the total price. Nightly rates are $200 for one or two nights; $180 for three or four nights; $160 for five, six, or seven nights; and $145 for eight nights or more.arrow_forwardCreate an application that calculates a car’s gas mileage. The formula for calculating the miles that a car can travel per gallon of gas is: MPG=milesgallonsIn the formula MPG is miles-per-gallon, miles is the number of miles that can be driven on a full tank of gas, and gallons is the number of gallons that the tank holds. The application’s form should have TextBox controls that let the user enter the number of gallons of gas the tank holds and the number of miles the car can be driven on a full tank. When the Calculate MPG button is clicked, the application should display the number of miles that the car can be driven per gallon of gas. The form should also have a Clear button that clears the input and results, and an Exit button that ends the application. If the user fails to enter numeric values, display an appropriate error message and do not attempt to perform calculations.arrow_forward
- Property Tax If you own real estate in a particular county, the property tax that you owe each year is calculated as 64 cents per $100 of the property’s value. For example, if the property’s value is $10,000, then the property tax is calculated as follows: Tax = $10,000 ÷ 100 × 0.64 Create an application that allows the user to enter a property’s value and displays the sales tax on that property.arrow_forwardTip, Tax, and Total Create an application that lets the user enter the food charge for a meal at a restaurant. When a button is clicked, the application should calculate and display the amount of a 15 percent tip, 7 percent sales tax, and the total of all three amounts.arrow_forwardTheater RevenueA movie theater only keeps a percentage of the revenue earned from ticket sales. The remainder goes to the movie company. Create a GUI application that allows the user to enter the following data into text fields:� Price per adult ticket� Number of adult tickets sold� Price per child ticket� Number of child tickets soldThe application should calculate and display the following data for one night�s box office business at a theater:� Gross revenue for adult tickets sold. This is the amount of money taken in for all adult tickets sold.� Net revenue for adult tickets sold. This is the amount of money from adult ticket sales left over after the payment to the movie company has been deducted.� Gross revenue for child tickets sold. This is the amount of money taken in for all child tickets sold.� Net revenue for child tickets sold. This is the amount of money from child ticket sales left over after the payment to the movie company has been deducted.� Total gross revenue. This…arrow_forward
- Python programming language You will be creating an application to calculate the maximum amount of contribution a person can make to a Roth IRA based on their age and income. Over 50 years old and your contribution limit goes up from $6000 to $7000 dollars. However, if the person is married and the combined household income is over $206,000 a year, or a single person with income over $139,000, you are not allowed to contribute. Write an application that asks the user their age and their income. Using this information use a nested if statement to calculate the maximum allowable contribution.arrow_forwardWhen an object is falling because of gravity, the following formula can be used to determine the distance the object falls in a specific time period:d =1/2 gt2The variables in the formula are as follows: d is the distance in meters, g is 9.8, and t is the amount of time in seconds that the object has been falling. Create an application that allows the user to enter the amount of time that an object has fallen and then displays the distance that the object fell. The application should have a method named FallingDistance. The FallingDistance method should accept an object’s falling time (in seconds) as an argument. The method should return the distance in meters that the object has fallen during that time interval.arrow_forwardC# onlyarrow_forward
- 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:Distance = Speed × TimeFor example, if a train travels 40 miles per hour for 3 hours, the distance traveled is 120 miles. Create an application with a form. The user enters a vehicle’s speed and the number of hours traveled into text boxes. When the user clicks the Calculate button, the application should use a loop to display in a list box the distance the vehicle has traveled for each hour of that time period.arrow_forwardProgramName: Chapter3StadinumSeatingProgram There are three seating categories at an athletic stadium. For a baseball game, Class A seats cost $15 each, Class B seats cost $12 each, and Class C seats cost $9 each. Create an application that allows the user to enter the number of tickets sold for each class. The application should be able to display the amount of income generated from each class of ticket sales and the total revenue generated. The application's form should resemble the one shown in below. X A Stadium Seating Revenue Generated Tickrts Sød Enter the rumber of tickets sold for coch dass of sects. Cass A Class B Cass A: lass C Caes B: Oless C Total Calculate Revenue Cear Ext Use the following sets of test data to determine if the application is calculating properly:arrow_forwardTEMPERATURE CONVERTER WEBSITE The user will input a temperature in either Fahrenheit or Celsius and press a "convert" button. The converted temperature will then be displayed with the correct unit. Your Ul should include four main elements: Input field for the user to type in their temperature - don't forget to validate that the input is a number! Dropdown menu or radio button for the user to choose if they are inputting in Celsius or Fahrenheit "Convert" button to trigger the temperature conversion Display area for the final converted temperature and unit For an extra challenge: You can add in a third conversion option to convert from and to Kelvin as well. please Don't Copy from internetarrow_forward
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningNp Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage