Question: visual studio design for calculator execute the code when calculate button is pressed and please help me to fix the code below. using System; using

visual studio design for calculator







execute the code when calculate button is pressed and please help me to fix the code below.

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls;

public partial class frmSalaryCalculator : System.Web.UI.Page { public object ErrorMessage { get; private set; }

protected void Page_Load(object sender, EventArgs e) { //Clear any error messages ErrorMessage.Text = "";

//Calculate your annual wage and display it decimal txtAnnualHours = 0;

//Check if your hourly wage is a valid decimal value if (Decimal.TryParse(txtAnnualHours.Text, out txtAnnualHours)) { //Calculate salary and store it within your Salary Textbox (wage times 40 hours per week and 52 weeks) txtPayRate.Text = (txtAnnualHours * 2080).ToString("C");

} else { //Display an error ErrorMessage.Text = "Please ensure your hourly wage is a proper decimal value."; } } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!