Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C# Visual Studio. CS Write a program that can be used to convert meters into fee

ID: 3666773 • Letter: C

Question

C#

Visual Studio. CS

Write a program that can be used to convert meters into feet and inches. You should use methods to accomplish this. There should be a method for each of the following: 1. Convert meters to feet and 2. Convert meters to inches. Your application should resemble the screenshot below. Challenge: Allow the user to convert from feet and inches into meters. If the meter amount is less than .5, use centimeters instead. Your program should contain the two methods above in addition to methods for each of the following: 1. Convert feet to meters, 2. Convert inches to meters, and 3. Determine if the use of centimeters is necessary, and if so, convert to centimeters.

Explanation / Answer

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 meter_2_feet_and_inches
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
double m = Convert.ToInt32(textBox1.Text) / 3.28;
label1.Text = m.ToString ();
}

private void button2_Click(object sender, EventArgs e)
{
double m = Convert.ToInt32(textBox2.Text) * 0.025;
label2.Text = m.ToString();
}
}
}