Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Extra 9-1 Calculate reservation totals In this exercise, you'll add code that calculates the number of nights, total price, and average price for a reservation

image text in transcribed
Extra 9-1 Calculate reservation totals In this exercise, you'll add code that calculates the number of nights, total price, and average price for a reservation based on the arrival and departure dates the user enters Departure dete: 10/21/2016 mberf nights Tetal prce: $480.00 Avg pice per nighe $160 00 Open the project and implement the calculations 1. Open the Reservations project in the Extra Exercises Chapter 09 Reservations directory 2. Add code to get the arrival and departure dates the user enters when the user clicks the Calculate button. Then, calculate the number of days between those dates, calculate the total price based on a price per night of $160, calculate the average price per night, and display the results. Test the application to be sure it works correctly. At this point, the average price will be the same as the nightly price. 3. Enhance the way the form works 4. Add an event handler for the Load event of the form. This event handler should get the current date and three days after the current date and assign these dates to the Arrival Date and Departure Date text boxes as default values. Be sure to format the dates as shown above. 5. Modify the code so Friday and Saturday nights are charged at $180 and other nights are charged at S160. One way to do this is to use a while loop that checks the day for each date of the reservation. 6. Test the application to be sure that the default dates are displayed correctly and Add code to validate the dates 7. Add code to the IsDateTime method to check that the arrival and departure dates 8. Add code to the IsWithinRange method to check that the arrival and departure that the totals are calculated correctly are valid dates. dates are within a range that includes the minimum and maximum dates that are passed to it. Add code to the Is ValidData method that uses the IsPresent, IsDateTime, and Is WithinRange methods to validate the arrival and departure dates. These dates should be in a range from the current date to five years after the current date 9

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

More Books

Students also viewed these Databases questions