subject

Private void btnCalculate_Click(object sender, System. EventArgs e) {
decimal weightInPounds = 0m;
try
{
weightInPounds = Convert. ToDecimal(txtPounds. Text);
if (weightInPounds > 0)
{
decimal weightInKilos = weightInPounds / 2.2m;
lblKilos. Text = weightInKilos. ToString("f2");
}
else
MessageBox. Show("Weight must be greater than 0.", "Entry error");
txtPounds. Focus();
}
catch(FormatException)
{
MessageBox. Show("Weight must be numeric.", "Entry error");
txtPounds. Focus();
}
}
If the user enters 118 in the text box and clicks the Calculate button, what does the code do?

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 06:00
What machine listens for http requests to come in to a website’s domain? a. a router b. a browser c. a server d. a uniform resource locator
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
To check whether your writing is clear , you can
Answers: 2
question
Computers and Technology, 24.06.2019 16:50
7.23 main lab 7 - online shopping cart background this main lab extends the earlier prep lab "online shopping cart part 1". (you should save this as a separate project from the earlier prep lab). you will create an on-line shopping cart like you might use for your on-line purchases. the goal is to become comfortable with setting up classes and using objects. requirements this lab can be done individually or as pair programming. expanded itemtopurchase class (15 points) extend the itemtopurchase class as follows. we will not do unit testing in this lab so we will not be giving you the names of the member functions. create good ones on your own. create a parameterized constructor to assign item name, item description, item price, and item quantity (default values of "none" for name and description, and 0 for price and quantity). additional public member functions set an item description get an item description print the cost of an item - outputs the item name followed by the quantity, price, and subtotal (see example) print the description of an item - outputs the item name and description (see example) additional private data members a string for the description of the item. example output of the function which prints the cost of an item: bottled water 10 @ $1.50 = $15.00 example output of the function which prints the item description:
Answers: 1
question
Computers and Technology, 24.06.2019 17:40
Create a file called favorite_foods, and list your favorite foods, entering five or six or more. press enter after each favorite food so it appears on its own line (make certain you also press enter after the final food item). after the file is created, add two more foods you like that are not on the list (press enter after the final food item). view the list of foods to make certain the two items you added appear at the end of the list
Answers: 2
You know the right answer?
Private void btnCalculate_Click(object sender, System. EventArgs e) {
decimal weightInPounds...
Questions
question
Mathematics, 09.10.2019 12:30
Questions on the website: 13722362