Skip to content

Yinmisan/typescript-assingment-of-2-weeks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Assalam u Alaikum @all

Everybody has to do the assignment this one also the previous week one and have to push the code to GITHUB

Assignment from previous week

Assignment for the week is:

  • Create a function that takes an array, an index, and a value as parameters. Inside the function, use the splice method to insert the value at the specified index in the array. Return the modified array.
  • Implement a simple shopping cart program using an array. Create functions to add items, remove items, and update quantities using the splice method. Print the cart's contents after each operation
  • Write a program that uses a while loop to print the first 25 integers.
  • Write a program that uses a while loop to print the first 10 even numbers.
  • Create a function that takes a positive integer as parameter and uses a while loop to calculate and return the factorial of that number.
  • Write a program having an array of numbers if the number is negative it should remove the negative number from the array.
  • Create a function that takes an array of numbers as parameter. Use a while loop to calculate and return the sum of all the numbers in the array.
  • Implement a program that takes a list of temperatures in Celsius as input from the user. Convert each temperature to Fahrenheit using the formula F = (C * 9/5) + 32 and store the converted temperatures in an array. Use a while loop to perform the conversion for each temperature.

After completing the assignment everybody have to fill the form: https://forms.gle/vqNj8BeDT28wtmVU8

This form will be closed on 02-sept-2023 at 5 PM

Assignment for the week:

  • Develop a program that calculates and prints the sum of the first n even numbers using a for loop.
  • Implement a program that uses a for loop to iterate through an array of numbers and print only the even numbers.
  • Implement a program that uses a loop to iterate through an array of numbers and remove all the even numbers from them and just leave the odd ones
  • Write a program that defines a function to calculate the area of a circle. The function should take the radius as input and return the calculated area.
  • Develop a program that reads a list of grades and uses the splice method to remove failing grades (below 50) from the array.
  • Write a program that uses a function to find the largest element in an array of numbers.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published