Answer to Question #13975 in C# for Sifsilva

Question #13975
Write an application that will accept two decimal values in textboxes and calculate the sum and the quotient.When button Calculate1 is clicked • The two numbers are stored in variables • Call one method Calculate to perform calculations • Display results on labels Methods.Method Calculator uses call-by-value and call-by-reference(Ref) parameters to return thevalues.
1
Expert's answer
2012-08-30T12:02:51-0400
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Quotient
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void btnCalculate_Click(object sender, EventArgs e)
{

int result;
int sum;
sum=int.Parse(txtFirst.Text)+int.Parse(txtSecond.Text);
int quotient = Math.DivRem(int.Parse(txtFirst.Text), int.Parse(txtSecond.Text), out
result);
lblResult.Text ="Quotient= "+quotient.ToString() + " " + result.ToString() + " Sum= " + sum.ToString();
}


}
}


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS