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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started