Question: This is a JavaScript 2 question for course INFO 2134. Assignment 6 How to do the steps below (Task 2 and Task 3) using JavaScript

This is a JavaScript 2 question for course INFO 2134.

Assignment 6

How to do the steps below (Task 2 and Task 3) using JavaScript code?

The code needed for this task will be provided under the required steps.

Thank you!

TASK 2:

50points

You will use your web browser and Visual Studio code to complete Task 2. The browser developer tools may be helpful.1.Open assignment06>converterhelper.js examine the code provided to you, which is shown below in Figure 1. DO NOT MODIFY THE CODE PROVIDED TO YOU. You will add your code beneath the comment indicating where to add your code.Figure 12.Define a new class named MetricToImperial, which extends the Converter class(5 points per method):a.The constructor function should accept a valueand immediate invoke the parent class constructor, passing the value to the parent class. The parent class will perform data validation.b.Define the following instancemethods(if you need assistance, the formulas for each conversion may be found in the Appendix at the end of the assignment write-up):i.convertMetersToFeet()1.This method should accept no parameters.2.This method should return the value of _unitToConvert(stored in the parent class) to feet.ii.convertMetersToMiles()1.This method should accept no parameters.2.This method should return the value of _unitToConvert(stored in the parent class) to miles.Continued on the next page...

Assignment 6B

4iii.convertLitersToGallons()1.This method should accept no parameters.2.This method should return the value of _unitToConvert(stored in the parent class) to gallons.iv.convertLitersToQuarts()1.This method should accept no parameters.2.This method should return the value of _unitToConvert(stored in the parent class) to quarts.v.convertKilosToPounds()1.This method should accept no parameters.2.This method should return the value of _unitToConvert(stored in the parent class) to pounds.vi.convertCelsiusToFahrenheit()1.This method should accept no parameters.2.This method should return the value of _unitToConvert(stored in the parent class) to Fahrenheit.3.Define the following static method(15 points):i.toTwoDecimalPlaces()1.This method should accept asingle parameter. The body of the method should verify the parameter is a floating-point number:a.If the parameter is not a floating-point number, the method should throw an error.b.If the parameter is a floating-point number, the method should return the input value with two decimals of precision (i.e. two numeric values after the decimal point).Continued on the next page...

Assignment 6B5

TASK 3: 29points.

You will use your web browser and Visual Studio code to complete Task 3. The browser developer tools may be helpful.1.Open assignment06> script.js 2.Refactor your code to accomplish the following:a.For each conversion, use the appropriate method of the MetricToImperial class defined in converterhelper.js. Each converted value should be rounded-down to two decimals of precision using the toTwoDecimalPlaces() static function defined in the MetricToImperialclass.3.Once done, test all combinations of conversions. Ideally, we would use a test suite to facilitate regression testing; however, we will have to manually perform the regression testing ourselves.

Please complete Task 2 first.

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!