Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Visual C#-Lab M The principal purposes of this lab exercise are to provide experience in: creating form controls including labels, text boxes, working with the

image text in transcribed
image text in transcribed
Visual C#-Lab M The principal purposes of this lab exercise are to provide experience in: creating form controls including labels, text boxes, working with the focus method masked text boxes, buttons, group boxes, radio buttons, and check boxes working with if decision structures sizing and aligning controls on a form performing mathematical calculations declaring and using constants and variables converting data between data types working with the Enabled and checked properties formatting numeric data for display Text Boxes: Pet Boutique - Service Form Owner Name TextBox Masked Text Boxes: petNameTextBox Pet Owner owner Phone MaskedTextBox typellOtherTextBox Quelle Jonathan Dom petDOBMaskedTextBox Ogwr Phone: 212) 555-1234 Radio Buttons: Group Boxes: catRadioButton Pet petOwnerGroupBox dog RadioButton Ex Name: Sylvester petGroupBox otherRadioButton Pel Duled Orth: 11/30/2013 services GroupBox Labels: Pet Type: Dog O NeaRemovalPriceLabel Check Boxes: ficaRemoval CheckBox nailClipping Pricelabel shampoo PriceLabel Services nailClippingCheckBox furTrimming Price Label Den Remove $500 shampooCheckBox Sw 5400 totalFeeLabel fur TrimmingCheckBox Haiu H Fu To $900 (all separate from the check box labels) To Fee $13.50 Buttons: totalButton (plus labels for other clearButton form controls with Q quitButton default names used] You are to create the data-entry form shown above. Include all of the following in your program: Using a project name of Lab 3-1. create the form and all its controls as shown in the diagram above. Name all controls that may be referenced in code with standard naming conventions as shown above. Group boxes should be used, as shown to logically group telated data. It is easiest to create the group box controls first and then to add the other controls into theth, Note that, since the user will not directly enter data for the value of Total Fee this value is displayed in a lubel. Hine: To achiew the bordered appearance of this control as shown above, set its Border Style property to FixedSingle and its Autosise property to False The Tab Order should be correctly set, so that the focus moves in a logical sequence through the controls The two masked text boxes should utilize datamasks appropriate for the data to be entered. Hint: Click in the Mask property for these controls and then click on the small button that will appear there that has three dots on it: this will open an Input Mask screen from which you can select the appropriate mask. The default selection for the group of radio buttons should be "Cat Hint: This can be established or design time by setting this contra Checked property to The . . . . . The code for this project should include the features described below. After completing each step, run the pro- gram to see if any errors are reported. Correct any such errors before proceeding with the next step. Remember to include comments throughout the program to identify the purpose of key statements and blocks of code. The first lines of the program are to be comments similar to the following // Programmer: Your Name // Project: tab 3-1 // Date: 2/19/2021 1 Dencription: form for taking a pet care order. Constants should be declared to store values for the four service prices. These can be declared at the class level. A variable should be declared for the total ee value that will be calculated by the program (described below). This variable can be declared in the Click event handler of the Total button. When the program is run, the text box labeled "Type (if Other)", along with the label itself, should initially be disabled (ie., the Enabled property for these two controls should be set to false). During run time, if the Other radio button is selected, the label and the text box should both be enabled. Hint: You will need to use an f-else statement within the CheckedChanged event handler for this radio button. In addition, if the user clicks the Other radio button, the focus should be sent to the text box labeled "Type (if Other)". Hint: Use the Focus method of the text box to do this. Note: Desclecting the Other radio button should again disable the "Type (if Other)" label and text box and clear any entry into the text box. [Comment: In a "real" application, this section might be better handled with a user-editable combo box. However, we will use the approach despibed here for practice in manipulating the specified properties.) The prices for the services (e.g., $5.00) should be displayed in labels that are next to, but separate from the check boxes. Hint: You will increase the case of maintaining your program if you store the service prices in named constants, declared at the class level. (Should the prices change in the future, it will be easy to update them there. The four labels can then be used to display the constant values containing the service prices on the form. E.S.: shampooPriceLabel.Text = SHAMPOO PRICE.ToString(""); (The constants will also be used in the calculation of the total fee value.) YOU NEED TO USE THE FORM LOAD EVENT TO ASSIGN THE CONSTANT VALUES TO THE FOUR PRICE LABELS. (SEE PP. 332-335 IN THE TEXTBOOK FOR A DESCRIPTION OF THE LOAD EVENT.) The actual Total Fee calculated by your program is to be the sum of the services ordered. Up to four services may be ordered by the customer.) Hint: Lise the Checked property of each check box in a series of if statements here. This calculation is to be performed, and the value displayed in the Total Fee label, when the user clicks the Total button. Clicking this button should also cause the focus to move to the Clear button. Use Access Keys for all three buttons, as shown in the form screen shot on the previous page. When the user clicks the Clear button, the form controls should be cleared and the form reset to the same appearance it has when the program begins. Clicking this button should also cause the focus to move to the first data entry control on the form (the Owner Nume text box). When the user clicks the Quit button, the Close method should be used to exit the program, Save your project and then run it. Enter the sample data shown on the previous page and click the Totul button The appearance of the form, and the calculated value, should be as shown on the previous page. When you have completed this project, you may exit Visual Studio (Don't forget to take your USB drive with you, if you are using one on a lab computer) You should seek additional practice in writing Visual C# programs to process data by attempting several of the Chapter 4 end-of-chapter Programming Problems on pages 265.269 of the textbook Such repeated practice is crucial to mastering the skills presented in this chapter Visit the class TAS, or your instructor during his office hours, to discuss questions or problems that you may have with these Programming Problems

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

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

More Books

Students also viewed these Databases questions