0% found this document useful (0 votes)
2 views3 pages

Assignment 01 - Module Import Export

This document is an assignment for B.Tech 3rd Semester students at Gandhi Engineering College focusing on Node JS module import and export concepts. It includes a series of questions categorized into 2, 5, and 10 marks, covering definitions, syntax, and practical programming tasks related to JavaScript modules. The assignment is due on June 25, 2026.

Uploaded by

babudehuri96921
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

Assignment 01 - Module Import Export

This document is an assignment for B.Tech 3rd Semester students at Gandhi Engineering College focusing on Node JS module import and export concepts. It includes a series of questions categorized into 2, 5, and 10 marks, covering definitions, syntax, and practical programming tasks related to JavaScript modules. The assignment is due on June 25, 2026.

Uploaded by

babudehuri96921
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

GANDHI ENGINEERING COLLEGE, BHUBNESHWAR

[Link] 3rd Semester (CSE, AIML and DS)


Node JS
ASSIGNMENT 01
Module Import & Export Questions
2 Marks Questions
1. What is a module in JavaScript?
2. What is the purpose of export in JavaScript?
3. What is the purpose of import in JavaScript?
4. What is a Named Export?
5. What is a Default Export?
6. What is the difference between Named Export and Default Export?
7. Which keyword is used to export all functions from a module?
8. What file extension is commonly used for JavaScript modules?
9. What is the advantage of using modules in JavaScript?
10. What is the syntax for importing a named export?
11. What is the syntax for importing a default export?
12. What symbol is used while importing named exports?

5 Marks Questions
1. Write a JavaScript program to create a module named [Link] that exports two functions: add ()
and multiply (). Import them into [Link] and display the results.

2. Write a JavaScript program to export a default function named greet () from [Link] and import
it into [Link].

3. Create a module named [Link] that exports student details (name, age of yours). Import and
display them in another file.

4. Write a JavaScript program to export a function named calculateArea () and import it in another
file and calculate the circle of area.

5. Write a JavaScript program to export a product object with id, name and price. Import it and access
in different file.

10 Marks Questions
6. Create a module named [Link] that exports add(),subtract(),multiply() and divide().Import all
functions and perform calculations.
7. Create a module [Link] that exports the following functions:
• calculateSalary(basicSalary, bonus)
• calculateTax(salary)
Import these functions into [Link] and display:
Input:
Basic Salary: 50000
Bonus: 10000
Tax = 10 %
Output:
Total Salary: 60000
Tax Amount: 6000
Net Salary: 54000
8. Create a module [Link] that exports:
• calculateTotal(m1,m2,m3,m4,m5)
• calculatePercentage(total)
Import the functions and display:
Input: 80, 75, 90, 85, 70
Output:
Total Marks = 400
Percentage = 80 %
9. Create a module [Link] that exports:
• calculateBill(units)
• displayBill(units, amount)
Billing Rules:

0-100 Units → ₹2 per unit


101-200 Units → ₹3 per unit
Above 200 Units → ₹5 per unit
Input:
250 Units
Output:
Units Consumed = 250
Total Bill = ₹1250
10. Create a module [Link] that exports:
• deposit(balance, amount)
• withdraw(balance, amount)
• checkBalance(balance)
Import and perform:
Initial Balance = ₹10000
Deposit = ₹5000
Withdraw = ₹2000
Output:
Current Balance = ₹13000
11. Create a module [Link] that exports:
• addProduct(price, quantity)
• calculateDiscount(total)
• finalBill(total, discount)
Rules:
Discount = 15%
Input:
Laptop = ₹50000 × 2
Output:
Total Amount = ₹100000
Discount = ₹15000
Final Bill = ₹85000
12. Create a module [Link] that exports:
• areaOfCircle(radius)
• areaOfRectangle(length, breadth)
• areaOfTriangle(base, height)
Import all functions using:
import * as geo from './[Link]';
Output:
Circle Area = 78.5
Rectangle Area = 50
Triangle Area = 25

Last Date of Submission: 25th June, 2026

You might also like