Question: Visual Studio 1.For this lab you will debug the Tip Calculator app that is provided for you in the TipCalculator-Wk4 folder. In your Week 4

Visual Studio

1.For this lab you will debug the Tip Calculator app that is provided for you in the TipCalculator-Wk4 folder. In your Week 4 Lab/Readme.md file, list and identify all errors that you find. Specify which file had the errors, what the error was and state what you did to fix the error.

2.Use the Error List window to find and correct any syntax errors that display when you try to run the app. Be sure to write down the errors as you encounter them. Put comments in your code to help you keep track of the errors.

3.Use the Internal Server Error page and its stack trace to find and correct any unhandled exceptions that occur when you run the app.

4.Set a breakpoint in the model class and step through its code to find the error that leads to the app calculating an incorrect tip amount.

5.Use the Developer Tools (as shown below) to find and correct the CSS issue that prevents the label elements from displaying with the expected width.

tipcalculator.cs:

using System.ComponentModel.DataAnnotations;

namespace TipCalculator.Models { public class Calculator { [Required(ErrorMessage = "Please enter a value for cost of meal.")] [Range(0.0, 10000000.0, ErrorMessage = "Cost of meal must be greater than zero.")] public double? MealCost { get; set; }

public double CalculateTip(double percent) { if (MealCost.HasValue) { var tip = MealCost.Value / percent; return tip } else { return 0; } } } }

site.css:

body { padding: 1em; font-family: Arial, Arial, Helvetica, sans-serif; }

h1 { margin-top: 0; color: navy; }

label { display: inline-block; widht: 10em; padding-right: 1em; }

div { margin-bottom: .5em; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!