Skip to content

GDG-BACKEND-NODE-JS-ASSIGNMENTS/js-session-3-task-6

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“Œ Student Task 6

In this assignment, you will practice working with JavaScript string and number methods.

βœ… Requirements

  1. Create a function capitalizeWords(str) that capitalizes the first letter of each word in a string.
  2. Create a function reverseString(str) that returns the reversed version of the string.
  3. Create a function calculateAverage(numbers) that returns the average of an array of numbers (rounded to 2 decimal places).

πŸ“‚ File Structure

  • Write your code only in the following file:
    πŸ“ Assignment/index.js
  • Do not modify any other files. If you edit other files, your submission will be rejected.

πŸ“ Instructions

  • Write your code in the Assignment/index.js file.
  • Export all functions using this format at the end of the file:
module.exports = { capitalizeWords, reverseString, calculateAverage };

🧠 index.js (Student Starter File)

// Function to capitalize the first letter of each word in a string
function capitalizeWords(str) {
  // TODO: Write code here
}

// Function to reverse a string
function reverseString(str) {
  // TODO: Write code here
}

// Function to calculate the average of an array of numbers
function calculateAverage(numbers) {
  // TODO: Write code here
}

// Export the functions for testing
module.exports = { capitalizeWords, reverseString, calculateAverage };

πŸš€ Submission Guidelines

  • Ensure your functions are correctly implemented and exported.
  • Push your code to GitHub Classroom before the deadline.
  • Breaking any rules (e.g., modifying other files) will result in submission removal.

Good luck! 🎯

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published