Give you practice using the Microsoft Visual Studio Net IDE

Give you practice using the Microsoft Visual Studio Net IDE. (2) Give you practice with basic programming skills. coding formula and computations You will be graded on the following criteria (1) programming style. (2) correct answers, (3) case of understanding(4) case of Problems: Conversions Write a program that requests a single real number, i.e., one containing a decimal point, and converts that value in one unit of measurement to another unit of measurement The program mint display a message telling its user what it is programmed to do For example. \"Convert kilometer to miles \" It must then prompt the met to enter decimal number representing the number of kilometers The purpose of a prompt is to alert the user that data must be entered and the type of data to be entered. Without a prompt, a met would not know what data to enter or when lo input the data After receiving the data and making the correct conversion. the program must display a message relating the number of kilometers and the corresponding number of miles Make sure that your program clearly labels each number with its proper physical units so that someone viewing the screen/file can clearly understand what the output means. For the program you will need to know that 1 mi = 1 66093440 km

Solution

1.

aspx.cs file

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

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
double miles = Convert.ToDouble(TextBox1.Text);
double kms = miles * 1.6093440;
TextBox2.Text = kms.ToString();
}
}

.aspx

<html xmlns=\"http://www.w3.org/1999/xhtml\">
<head runat=\"server\">
<title></title>
</head>
<body>
<form id=\"form1\" runat=\"server\">
<div>
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Enter Miles
<asp:TextBox ID=\"TextBox1\" runat=\"server\"></asp:TextBox>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Kms<asp:TextBox ID=\"TextBox2\" runat=\"server\"></asp:TextBox>
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID=\"Button1\" runat=\"server\" onclick=\"Button1_Click\"
Text=\"Convert Miles to Kms\" />
  
</div>
</form>
</body>
</html>

2.

#include <stdio.h>

int main(void)
{
   int x,y,temp;
   printf(\"\ Enter the value of two integers\");
   scanf(\"%d %d\",&x,&y);
  
   printf(\"\ x = %d\",x);
   printf(\"\ y = %d\",y);
  
   temp = x; //store value of x in temp variable
   x = y; // assign value of y to x
   y = temp; // assign value stored in temp to y
  
   printf(\"\ swapped value of x = %d \",x);
   printf(\"\ swapped value of y = %d\",y);
  
  
   return 0;
}

output:

 Give you practice using the Microsoft Visual Studio Net IDE. (2) Give you practice with basic programming skills. coding formula and computations You will be g
 Give you practice using the Microsoft Visual Studio Net IDE. (2) Give you practice with basic programming skills. coding formula and computations You will be g

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site