Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I really need help with this code or just a similar one to use as an example Using C# on Microsoft Visual Studio. HOMEWORK REQUIREMENTS
I really need help with this code or just a similar one to use as an example Using C# on Microsoft Visual Studio.
HOMEWORK REQUIREMENTS
- At the top of the project form should be a PictureBox control that displays an image related to motels. (Search the Web for an appropriate motel image file to import into your project for use in the PictureBox.)
- Beside, or below, the PictureBox should be a Label control used to display the text "Motorway Motel" (without the quotation marks). This text should display in a large font size (e.g., greater than 20 point size). The fore-ground and background colors of this label must be changed from the default colors to other colors of your choosing. The label should also include a border.
- Directly below this PictureBox and Label is to be a control into which the user can enter the date ( in 00/00/0000 format) on which the guest is checking out of the motel. (All input and output controls must be properly labeled.)
- Next, four groups of controls (described directly below) should be set apart by the use of four GroupBox controls.
- Guest Information - Two controls must be provided in which the guest's first name and last name can be entered.
- Room Information - A control must be provided in which the clerk will enter the guest's room number which is always exactly 3 digits in length (e.g., 205). Also provided must be controls to hold the number of nights the guest has stayed at the motel as well as the nightly dollar rate charged for the room.
- Additional Charges - Here, three controls must be provided into which the clerk can enter any optional charges which are separated into three amounts: mini bar charges, telephone charges, and miscellaneous charges.
- Billing Summary - Here are five output controls that display the results of the calculations described below.
- All calculations are to be initiated by the user clicking a Total button. When this button is clicked, the program is to calculate five values that are displayed in a column in the Billing Summary area: 1) room charges (the length of the stay in nights times the nightly room rate), 2) additional charges (the sum of the three optional charges described above), 3) subtotal (the sum of the room charges and the additional charges), 4) tax amount (the subtotal times the tax rate, which is currently 7%), and 5) total charges (the sum of the subtotal plus the tax). Separate the total charges value from the other values above it with a short horizontal line. (Hint: See Visual C# Lab II.) Also, when the Total button is clicked, the focus should be sent to the Clear button (described below).
- Your program code should utilize a Try-Catch statement so that the program will not crash if the user enters invalid data into any of the input controls. Instead, an appropriate error message should display if an error occurs. (Hint: Study the solution code for Programming Problem 3-14 to see how to allow null (blank) values to exist in one or more of the data input controls (e.g., the additional charges) without causing an error to occur.)
- There are to be four buttons in a row at the bottom of the form which initiate actions: Total, Clear, Help, and Exit (from left to right). There should be an Access Key defined for each of these four buttons
- The Clear button is to be used to clear the form controls and to return the form to its original state. When this button is clicked, all data entry boxes should be cleared as well as the controls displaying calculated data. Also, when this button is clicked, the focus should be sent to the first data entry control on the form.
- The Help button is to be used to display a message box to the user containing basic instructions for using the program. (Although this need not be elaborate, it should adequately cover all the steps required to use the form.)
- The Exit button is to be used to terminate the program. (Use the Close method to accomplish this.)
- You should design your program code to be flexible write your code so that likely future changes (e.g., tax rate changes) can be accommodated easily by yourself or another programmer. (Hint: Remember what a constant is.)
- You are to give meaningful names to all form controls used in your program and all constants and variables used in your code. Follow the standard C# naming conventions described in class and followed in your textbook.
- Use appropriate labels to clearly identify all input and output controls, and include a brief meaningful form description in the forms title bar.
- The alignment, spacing, and sizing of all controls should be appropriate, neat, and professional in appearance.
- Text displayed on the form must exhibit correct spelling, grammar, punctuation, and consistency of style.
- When the program runs, the form should display in the center of the screen.
- The tab order should be set correctly so that focus flows logically through the controls on the form.
- The Billing Summary out data (five currency values) should be displayed with the correct currency format.
- Data representing numeric values, including currency values, should be displayed right-aligned in controls, while text values (values not used in calculations, such as names) should be displayed left-aligned in controls.
- You should use comments very liberally throughout your program. Explanatory comments for each event handler as well as for each significant block of code are necessary.
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