CIT-110 C# Programming 1: Real Estate

Background:
The purpose of this assignment is to apply all that new knowledge you learned during our previous
classes. To recap we learned how to create a basic form, add controls, and adjust the form layout,
change properties, code click events and work with arrays and collections.
The owner of BDJ Real Estate of Springfield has hired you to design a sales analyzer program for real
estate sales. You can enter the property sales by supplying a valid sales dollar amount and pressing the
Add button. You don’t know up front of how many entries you will have. What makes more sense to
use an array or collection?
Once the data entry is complete you can press on the Calculate button to find out the different analytics
for the sales: Min, Max, Average, Median, Total and Commission.



There are three Label controls
There is one TextBox control
There are two ListBox controls
There are buttons Calculate, Add, Clear and Exit.
Odd Number Example

Even Number Example

1

2 .

3 .  The third label’s Name property should be lblAnalysis with the text of Property Value Analysis. aligned center with a max size of 8 5. Add 1 TextBox controls to the form and do the following:  The first Name property should be txtPropertyValue. 4. Set the tab order to move from the top of the screen to the bottom from left to right. Add 2 ListBox controls to the form and do the following:  The first Name property should be lstEnteredValues. 6.cs to frmRealEstateCollections. 2. Create a new C# Windows Forms Application called RealEstateCollections. Text property should be Calculate with an alternate key on the C  The second button’s Name property should btnAdd Text property should be Add with an alternate key on the A  The third button’s Name property should btnClear Text property should be Clear with an alternate key on the l  The fourth button’s Name property should btnExit. On the form do the following:  Using the Solutions Explorer Window change the File Name from Form1.cs  Using the Properties Window change the Text property to [Your Name] Real Estate  Have the form startup in the center of the screen 3. You shouldn’t stop at the output only ListBox controls.  The second Name property should be lstAnalysis.Grading Elements All Form properties set as instructed All Label properties set as instructed All TextBox properties set as instructed All Button properties set as instructed Tab Order properties set as instructed and not stopping at output only List Collection is populated correctly Data validation on the TextBox The Calculations are done properly All Controls and Variables coded with a prefix (Hungarian Notation) Code has comments Possible Points (100 total) 5 5 5 5 5 25 5 35 5 5 Detailed Instructions: 1. Add 4 Button controls:  The first button’s Name property should btnCalculate. Add 3 Label controls to the form and do the following:  The first label’s Name property should be lblPropertyValue with the text Property Value.  The second label’s Name property should be lblEnteredValues with the text of Entered Property Values. Text property should be Exit with an alternate key on the x  Use Visual Studio tools to make sure the Buttons are the same size. aligned to the bottom and have equal horizontal spacing  Link the btnCalculate to the form’s AcceptButton property  Link the btnExit to the form’s CancelButton property 7.

divide the count by 2 and use that entry as the median 2.Determine the Commission by multiplying the Total of the calculation by .  4 .. 9. Coding of the Add button:  Attempt to convert the value in the txtPropertyValue to a decimal.Determine the Maximum value in the collection and add to the lstAnalysis Listbox and format it as currency with 2 decimal positions. Something to think about: If the collection will be used in multiple click events. Something to think about: How can you declare the counter variable so the value is preserved when the click event is exited? 10. Determine the Average value in the collection and add to the lstAnalysis Listbox and format it as currency with 2 decimal positions. If the number of entries in the list collection is odd. select the text.Enter a loop to process each entry in the list collection and output the entry number and the value formatted it as currency with 2 decimal positions. Coding of Calculate button:  You can only perform the sales analysis if there are entries in the collection.8. set the focus and exit the event handler  If the TextBox value is a valid decimal add it to the list collection.03 and add to the lstAnalysis Listbox and format it as currency with 2 decimal positions. select the text. 5. 4. Take that that entry and the entry before it and average the two elements and use that as the median. 3. If it isn’t a valid decimal inform the user. If the number of entries in the list collection is even divide the count by 2. 6. how and where do you declare the list so the whole program can access it?  Add the decimal value to the lstEnteredValues ListBox and keep track of the number of entries. If the list collection has 0 entries inform the user..Sort the entries in the list collection 2.Determine the median as follows: 1. 7. Determine the Minimum value in the collection and add to the lstAnalysis Listbox and format it as currency with 2 decimal positions.Determine the Total value in the collection and add to the lstAnalysis Listbox and format it as currency with 2 decimal positions. Coding of the Exit button:  Exit the application Congratulations you did it! Take how many hour$ you worked on thi$ application and multiply it by $60 and that i$ how much money you would make being a C# con$ultant. 8. set the focus and exit the event handler:  If the collection does have value(s) do the following: 1. Coding of the Clear button:  Clear the txtPropertyValue TextBoxes  Clear the lstEnteredValues ListBox  Clear the listDecPropertyValuesListBox  Clear the list collection  Reset the counter that keeps track of on the number of entries 11.