SpaceMage
asked on
I need some help coding for a assignment.
I marked which one I need help the most. In parenthesis.
Requirement 1: Make sure the form is named SercviceForm. Change the Forms Text property to “Pet Boutique Service Form”.
Service Form.png
View in a new window
Requirement 2: When the user selects service options and clicks on the Total button, the application displays the appropriate Total Fee amount.
INSTRUCTIONS:
(5 Points) Open Visual Studio and create a new Window Application Project. Name the Project Lab3. NOTE: Ensure that C# is the programming language selected.
(5 Points) Make sure the form is named ServiceForm. Change the Forms Text property to “Pet Boutique Service Form”. Re-size the form to Width = 400, Height = 450.
(30 Points) Setup the applications form as shown in the screen shot above. As you place each of the controls on the form, refer to the following:
Text Boxes:
ownerNameTextBox
ownerPhoneTextBox
petNameTextBox
petDOBTextBox
Radio Buttons:
catRadioButton
dogRadioButton
Labels:
fleaRemovalPriceLabel ($5.00)
shampooPriceLabel ($4.00)
totalFeeLabel (Total Fee:)
priceLabel (will include the total price)
(all separate from the check box labels)
[plus labels for other form controls – with default names used]
Group Boxes:
petOwnerGroupBox
petGroupBox
servicesGroupBox
Check Boxes:
fleaRemovalCheckBox
shampooCheckBox
Buttons:
totalButton
clearButton
quitButton
(((((4. (35 Points) Add code to the totalButton that will do this following when the user clicks:
Create a Try and Catch block statement to store the code and trap the error if one occurs
Declare a double variable called TotalFee and intialize it to 0
Then set the value of the TotalFee variable to the appropriate value depending on the selected service check-boxes (fleaRemovalCheckBox $5, shampooCheckBox $4)
NOTE:
You will need to convert TotalFee variable to string before assigning it to the priceLabel.
Make sure that if both FleaRemoval and Shampoo are selected, the total fee represents the total amount of $9.))))))))
public partial class ServiceForm : Form
{
public ServiceForm()
{
InitializeComponent();
}
private void radioButton2_CheckedChange d(object sender, EventArgs e)
{
}
private void textBox2_TextChanged(objec t sender, EventArgs e)
{
}
private void label5_Click(object sender, EventArgs e)
{
}
private void totalButton_Click(object sender, EventArgs e)
{
try
{
const double TotalFee=0; //TotalFee Value
double
}
private void clearButton_Click(object sender, EventArgs e)
{
//Clear the TextBoxes
ownerNameTextBox.Text = "";
ownerPhoneTextBox.Text = "";
petNameTextBox.Text = "";
petDOBTextBox.Text = "";
// Reset the Focus();
ownerNameTextBox.Focus();
}
private void quitButton_Click(object sender, EventArgs e)
{
//close the form.
this.Close();
}
}
}
This is what I currently have..Please Help me I looked all over for guidance, but I cant get help. The assignment is due by Sunday. I would really like if someone can help me solve the last part in the parenthesis section I selected. So i can keep note of it in the future.. Thank you
Requirement 1: Make sure the form is named SercviceForm. Change the Forms Text property to “Pet Boutique Service Form”.
Service Form.png
View in a new window
Requirement 2: When the user selects service options and clicks on the Total button, the application displays the appropriate Total Fee amount.
INSTRUCTIONS:
(5 Points) Open Visual Studio and create a new Window Application Project. Name the Project Lab3. NOTE: Ensure that C# is the programming language selected.
(5 Points) Make sure the form is named ServiceForm. Change the Forms Text property to “Pet Boutique Service Form”. Re-size the form to Width = 400, Height = 450.
(30 Points) Setup the applications form as shown in the screen shot above. As you place each of the controls on the form, refer to the following:
Text Boxes:
ownerNameTextBox
ownerPhoneTextBox
petNameTextBox
petDOBTextBox
Radio Buttons:
catRadioButton
dogRadioButton
Labels:
fleaRemovalPriceLabel ($5.00)
shampooPriceLabel ($4.00)
totalFeeLabel (Total Fee:)
priceLabel (will include the total price)
(all separate from the check box labels)
[plus labels for other form controls – with default names used]
Group Boxes:
petOwnerGroupBox
petGroupBox
servicesGroupBox
Check Boxes:
fleaRemovalCheckBox
shampooCheckBox
Buttons:
totalButton
clearButton
quitButton
(((((4. (35 Points) Add code to the totalButton that will do this following when the user clicks:
Create a Try and Catch block statement to store the code and trap the error if one occurs
Declare a double variable called TotalFee and intialize it to 0
Then set the value of the TotalFee variable to the appropriate value depending on the selected service check-boxes (fleaRemovalCheckBox $5, shampooCheckBox $4)
NOTE:
You will need to convert TotalFee variable to string before assigning it to the priceLabel.
Make sure that if both FleaRemoval and Shampoo are selected, the total fee represents the total amount of $9.))))))))
public partial class ServiceForm : Form
{
public ServiceForm()
{
InitializeComponent();
}
private void radioButton2_CheckedChange
{
}
private void textBox2_TextChanged(objec
{
}
private void label5_Click(object sender, EventArgs e)
{
}
private void totalButton_Click(object sender, EventArgs e)
{
try
{
const double TotalFee=0; //TotalFee Value
double
}
private void clearButton_Click(object sender, EventArgs e)
{
//Clear the TextBoxes
ownerNameTextBox.Text = "";
ownerPhoneTextBox.Text = "";
petNameTextBox.Text = "";
petDOBTextBox.Text = "";
// Reset the Focus();
ownerNameTextBox.Focus();
}
private void quitButton_Click(object sender, EventArgs e)
{
//close the form.
this.Close();
}
}
}
This is what I currently have..Please Help me I looked all over for guidance, but I cant get help. The assignment is due by Sunday. I would really like if someone can help me solve the last part in the parenthesis section I selected. So i can keep note of it in the future.. Thank you
why don't you try to do your homework yourself? You won't learn if you don't do them by yourself!
Helping people with homework (or anything that sounds like homework) is generally frowned upon here at EE. If you have a specific question, you'll probably get an answer, but just asking for help with your assignment probably won't.
ASKER
I understand the other parts.. its just the Try and catch for me is confusing. I have been looking for helpful answers, but its really confusing to me.
ASKER
Sorry... I tried it, but I cannot grasp the concept of it
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try starting with this, try-catch (C# Reference), then if you have any specific question post back here.
ASKER
Thank you I figured it out