Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function perimeterArea(arg1) {
- let r = Number(arg1);
- let calculatedArea = Math.PI * r * r;
- let calculatedParameter = 2 * Math.PI * r;
- console.log(calculatedArea.toFixed(2));
- console.log(calculatedParameter.toFixed(2));
- }
- perimeterArea("3");
- function weather(arg1) {
- let weather = arg1;
- if (weather == "sunny") {
- console.log(`It's warm outside!`);
- } else if (weather == "cloudy") {
- console.log(`It's cold outside!`);
- } else {
- (weather == "snowy")
- console.log(`It's cold outside!`);
- }
- }
- weather("snowy");
- function weather2(arg1) {
- let degrees = Number(arg1);
- if (degrees >= 26 && degrees <= 35) {
- console.log("Hot");
- } else if (degrees >= 20.1 && degrees <= 25.9) {
- console.log("Warm");
- } else if (degrees >= 15.00 && degrees <= 20.00) {
- console.log("Mild");
- } else if (degrees >= 12.00 && degrees <= 14.9) {
- console.log("Cool");
- } else if (degrees >= 5.00 && degrees <= 11.9) {
- console.log("Cold");
- } else {
- console.log("unknown");
- }
- }
- weather2(0);
- function isExcellent(arg1) {
- let evaluation = Number(arg1);
- if (evaluation >= 5.50) {
- console.log("Excellent!");
- }
- }
- isExcellent("5");
- function number(arg1, arg2) {
- let a = Number(arg1);
- let b = Number(arg2);
- if (a > b) {
- console.log(a);
- } else {
- console.log(b);
- }
- }
- number("-5", "3");
- function evenOrOdd(arg1) {
- let n = Number(arg1);
- if (n % 2 == 0) {
- console.log("even");
- } else {
- console.log("odd");
- }
- }
- evenOrOdd("2");
- function nums100To200(arg1) {
- let n = Number(arg1);
- if (n < 100 ) {
- console.log("Less than 100");
- } else if (n <= 200) {
- console.log("Between 100 and 200");
- } else {
- console.log("Greater than 200");
- }
- }
- nums100To200("250");
- function password(arg1) {
- let password = arg1;
- if (password == "s3cr3t!P@ssw0rd") {
- console.log("Welcome");
- } else {
- console.log("Wrong password!");
- }
- }
- password("s3cr3t!P@ss");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement