Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/morrismagic/algojs
https://github.com/morrismagic/algojs
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/morrismagic/algojs
- Owner: MorrisMagic
- Created: 2024-09-18T13:49:28.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-18T13:49:45.000Z (about 2 months ago)
- Last Synced: 2024-10-06T19:08:59.179Z (about 1 month ago)
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
//1 Leap Year Checker:
/*
function years(year) {
if ((year % 4 === 0 && year % 100 !== 0) || (year % 400 === 0)) {
return true;
} else {
return false;
}
}
const year = console.log(("Enter a year:"));
if (years(year)) {
console.log(`${year} is a leap year.`);
} else {
console.log(`${year} is not a leap year.`);
}*///2 Ticket Pricing
/*
function getTicketPrice(age) {
if (age <= 12) {
return 10;
} else if (age >= 13 && age <= 17) {
return 15;
} else {
return 20;
}
}
const age = parseInt(prompt("Enter your age:"));
const price = getTicketPrice(age);
console.log("The price of Ticket is :"+price+(" $"));*///3 Fibonacci Sequence
/*
function fibonacci(n) {
if (n <= 1) {
return n;
} else {
return fibonacci(n - 1) + fibonacci(n - 2);
}
}
console.log(fibonacci(20));*/