The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 314 Weeks Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
Please used Visual Studio for this homework. Thank you so much.
Visual C# – Lab IV
Â
         Form after loading or clearing:               Form after data entry and computing:
Â
| Â | Â | Â | Â |
| Â | Â | ![]() |
|
| Â | ![]() |
||
| Â | |||
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
Â
You are to create the data-entry form shown above.Includeallofthefollowinginyourprogram:
·        Using a project name of Lab 4-1(1), create a form and controls as shown in the diagram above(23). Name the controls using standard naming conventions (such as totalPriceLabel).
·        In the program code, take care to properly declare all constants and variables needed by your program. Make sure that the declarations are for appropriate data types and that the declarations are located in appropriate locations in the program code. Hint: In this program you should declare six constants(6) at the class level to handle the sales tax rates and commission rates described below. The five variables(5) used for the values used in the calculations should be declared in the Click event handler of the Compute Button.
·        The Tab Order should be correctly set(1), so that the focus moves in a logical sequence through the controls.
·        The Sale Date field should utilize a masked text box control with a mask of 00/00/0000 (1)in order to display the date with that format. Have the control automatically default to displaying the current date (i.e., the date the computer’s system clock provides) by placing the following code in the form’s Load event handler:(1)
  saleDateMaskedTextBox.Text = DateTime.Now.ToString("MM/dd/yyyy");
·        Have the program begin with the Residential radiobutton selected as the default property type(1) and the Hillsborough radio button selected as the default county(1).Hint: This can be established by setting the Checked property of each of theseradio buttons to True at design time.
·        The Property Price text box should require data entry and allow only numeric data entry(1). Write your code to enforce these requirements.Hint: Use a TryParse method in an if-else statement to do this(1). Your if-else statement should begin with the following line (assuming you have used these control and variable names): (1)
if (decimal.TryParse(propertyPriceTextBox.Text, out propertyPrice))
The if block of this if-else statement should contain the rest of the code for the Click event of the Compute button(1), while the else block should display an error message if the Property Price value is null or invalid(1).
·        The program user will not directly enter data for the values of State Sales Tax, County Sales Tax, CommisÂsion, and Total Price. These boxes should be labels(4), not text boxes. Hint: You achieve the lined border of these labels as shown above by utilizing the FixedSingle setting of theBorderStyle property(4). Also, set the AutoSize property of these labels to False(4).
·        When the user clicks the Compute button, the program should perform a variety of actions. Initially, the program should check to see if the user remembered to enter a value for Property Price(1). If that text box is empty, or a non-numeric value is entered, a message box should remind the user to enter a valid value (1)and the focus should be sent to that text box(1). When there is a valid value for Property Price, it should be used in calculating the values of the other fields(1). Here are the data values you need to use in your computations:
Â
                       State Sales Tax Rate:       0.06(1)
Â
|
                                                                 0.00 for Pasco(1)
                                                                 0.005 for Polk(1)
                       Commission Rates:          0.06 for Residential(1)
                                                                 0.05 for Commercial(1)
The values above are multiplied times the Purchase Price to determine the State Sales Tax(1), County Sales Tax(3), and Commission (2)values that are to be displayed on the form. The Total Price value to be displayed is the sum of the Purchase Price and the three calculated values just described(1). After thesecalculations are performed, the four calculated values should all be displayed with a currency format(4). All values should also display right-aligned in their controls(4). (The screen shot of the form on the right side of the previous page includes some sample data based on these values that you can use to validate your calculaÂtions.)Â
Also occurring as part of the Compute button’s Click event should be the saving of the form’s data to a text file. This text file should be named Properties.txt (1)and it should be located in the default location(1). (C# will store the file in the bin\Debug subfolder of the project folder by default.) Write your code so that each use of the Compute button appends the current form data to the end of the existing file(1). The format of the data in the text file can be seen in the example data below, which shows two sets of sample data in the file:(6)
Date: 10/19/2016
Property Price: $100,000.00
State Sales Tax: $6,000.00
County Sales Tax: $500.00
Commission: $5,000.00
Total Price: $111,500.00
Â
Date: 10/19/2016
Property Price: $125,000.00
State Sales Tax: $7,500.00
County Sales Tax: $1,250.00
Commission: $7,500.00
Total Price: $141,250.00
The final action to occur after the user clicks the Compute button should be the sending of the focus to the Clear button(1). (However, if null or invalid data was entered for the Property Price value, after the error message box displays(1), the focus should be sent to the Property Price text box for a correction to be made(1).)
·        When the user clicks the Clear button, all user-entered data and calculated data is to be cleared and the form returned to its original state(8). That is, the form should appear exactly the same way it appeared when it first loaded when the program was run. (Make sure that all default settings are restored, including resetting the radio buttons and displaying the current date in the Sale Date control.) This event should conclude with the focus being sent to the Property Price text box(1).
·        When the user clicks the Exit button, the Close method should be used to end the program(1).
·        ThereshouldbeAccessKeysforeachofthe three buttons(3). Also, there should be an appropriate ToolTip created for each of the three buttons(3) and all other controls on the form that the user can set or enter data into.
----------- Â ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly