Appropriate Arithmetic and Relational Operators - Computer Science Assessment Answer

Download Solution Order New Solution

Computer Science Assessment Task

1. Complete Programming Problem #1, Distance Calculator, on page 339 of the textbook. The ADDITIONAL REQUIREMENTS described below MUST also be implemented:

• Assume the value of Vehicle Speed in MPH may store whole or floating-point numbers (non-monetary).

• Assume the value of Hours Traveled can only store whole numbers.

• Prevent data conversion exception for the Vehicle Speed in MPH text box by using the appropriate TryParse method. If the data entered is invalid display an appropriate error message to the user, set the focus back to the text box causing the error, and either clear the text box or select all the data entered into it so that it can be replaced.

• Validate the input for the Vehicle Speed in MPH to make sure the data entered is greater than zero and does not exceed 180. If not, display an appropriate error message to the user, set the focus back to the text box causing the error, and either clear the text box or select all the data entered into it so that it can be replaced.

• Prevent data conversion exception for the Hours Traveled text box by using the appropriate TryParse method. If the data entered is invalid display an appropriate error message to the user, set the focus back to the text box causing the error, and either clear the text box or select all the data entered into it so that it can be replaced.

• Validate the input for Hours Traveled to make sure the data entered is greater than zero and not more than 50. If not, display an appropriate error message to the user, set the focus back to the text box causing the error, and either clear the text box or select all the data entered into it so that it can be replaced.

• Implement the following fields: o Total Distance which accumulates the distance for each entry (i.e., as shown in the ListBox control) o Total Hours Traveled which accumulates the hours traveled for each entry (i.e., as entered in the Hours Traveled TextBox control) o Total Trips which counts each entry (i.e., incremented each time the user clicks the Calculate Button control)

• Display appropriate output to the ListBox control as shown in the sample input-output document attached.

• Display Total Distance as a number with two-decimal places.

• Display Total Hours Traveled and Total Trips as a number with no decimal places.

• Calculate and display the Average Distance which is the Total Distance divided by the Total Trips (recall, average distance is not an accumulator or counter) formatted as a number with two-decimal places.

This Computer Science Assessment has been solved by our Computer Science experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.

Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.