Can you please answer the following question. The program is in JavaScript. Thank you!   Introduction: In this assignment we will demonstrate an understanding of functions and modules. 1. I struggle with doing metric conversions, so I'm going to have you write a conversion utility module to help me.  Start by creating a file called conversionutils.js. In this file, code the following functions:

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 8RQ
icon
Related questions
Question

Can you please answer the following question. The program is in JavaScript. Thank you!

 

Introduction: In this assignment we will demonstrate an understanding of functions and modules.

1. I struggle with doing metric conversions, so I'm going to have you write a conversion utility module to help me. 
Start by creating a file called conversionutils.js. In this file, code the following functions:

    a. centi_to_milli: Takes a value for centimeters and returns the value in millimeters.
    b. meter_to_centi: Takes a value for meters and returns the value in centimeters.
    c. kilo_to_meter: Takes a value for kilometers and returns the value in meters.
    d. inch_to_centi: Takes a value for inches and returns the value in centimeters.
    e. feet_to_centi: Takes a value for feet and returns the value in centimeters.
    f. yard_to_meter: Takes a value for yards and returns the value in meters.
    g. mile_to_meter: Takes a value for miles and returns the value in meters.
    h. mile_to_kilo: Takes a value for miles and returns the value in kilometers.
    

    Make sure to export your functions to make this a module. 
    
2. Create a file called conversion.js. Start by importing your conversionutils module. When I run the conversion program, it should display a menu with all the different conversion choices. When I make a selection, it should prompt me for a value and display the conversion result by invoking the function in the module. The program should continuously display the menu until I select the exit option. The program should display an error message if I select an invalid option and prompt me until I select a valid menu option.

Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

JavaScript... NOT HTML

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Datatypes
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,