Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Patti Garcia owns two cars, referred to as Car 1 and Car 2 . She wants to drive one of the cars to her vacation
Patti Garcia owns two cars, referred to as Car and Car She wants to drive one of the cars to her vacation destination, but she's not sure which one if any would cost her the least amount in gas. Create a Windows Forms application. Use the following names for the project and solution, respectively: Car Project and Car Solution. Save the application in the VBeChap folder. Change the form file's name to Main Form.vb Change the form's name to frmMain. FF A
a The application's interface should provide text boxes for Patti to enter the following five items: the total miles she will drive, Car s miles per gallon mpg Car s miles per gallon mpg Car s cost per gallon of gas, and Car s cost per gallon of gas. The cost per gallon of gas must be entered separately for each car because one car uses regular gas and the other uses premium gas. The interface should display the total cost of the gas if she takes Car and the total cost of the gas if she takes Car ; display both amounts with a dollar sign and two decimal places. It should also display the car she should take either Car or Car and approximately how much she will save by taking that car show the savings with a dollar sign and no decimal places If the total cost of gas would be the same for both cars, Patti should take Car because that is her favorite car.
b The three text boxes that get the trip miles and the miles per gallon should accept only numbers and the Backspace key. The two text boxes that get the cost per gallon should accept only numbers, the period, and the Backspace key.
c When a text box receives the focus, its existing text should be selected.
d The output should be cleared when a change is made to the contents of a text box in the interface.
e Test the application using and as the trip miles, Car s mpg Car s mpg Car s cost per gallon, and Car s cost per gallon, respectively. Hint: The total costs for Car and Car are $ and $ respectively. By taking Car Patti will save approximately $
f Now, change Car s mpg to Also, change Car s mpg to Which car should Patti take, and how much approximately will she save?
g Next, change Car s mpg and cost per gallon to and respectively. Which car should Patti take, and how much approximately will she save?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started