Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Food App Project #45

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions NikhilNama/Day-3.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Arrow Function
const Mul = (a, b) => {
return a * b;
};

console.log(Mul(18, 3));

// Self Invoking Function
(function (name) {
console.log("Hello", name);
})("Nick");

function runLenght(arr) {
let sum = 0;
for (let i = 0; i < arr.length; i++) {
sum += arr[i];
console.log("Run lenght Encoding is ", sum);
}
}
const arr = [1, 2, 3, 4, 5];

runLenght(arr);

// Task
const EvenOdd = (num) => {
if (num % 2) console.log("Odd Number");
else console.log("Even Number");
};

EvenOdd(11);

const user = {
username: "Swagath",
password: "admin123",
};

let { username, password } = user;

console.log(username);
console.log(password);
28 changes: 28 additions & 0 deletions NikhilNama/LearnJs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
let One = 3;
let Two = 3;

console.log("One == Two ", One == Two);

let js = "JavaScript";
let cpp = "C++";

console.log(js == cpp);

let n = [1, 2, 3];
let nums = [1, 2, 3];

console.log("n==nums ", n == nums);

let user1 = {
name: "Nick",
role: "Student",
country: "Ind",
};

let user2 = {
name: "Prashant",
role: "Faculty",
country: "Ind",
};

console.log("User 1 == User 2", user1 == user2);
70 changes: 70 additions & 0 deletions NikhilNama/conditionalStmts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
const arr = [1, 2, 3, 4, 5];

for (let i = 0; i < arr.length; i++) {
// loop
if (arr[i] % 2) {
// if condition
console.log("Odd Number: ", arr[i]);
} else {
// else
console.log("Even Number: ", arr[i]);
}
}
/**
* 90-A
* 70-90- B
* 60-70-C
* 50-60-D
* <50 -Fail
*
*/
const val = 10;

if (val > 10) console.log("Value is greater that 10");
else if (val > 0) {
console.log("Value is greater than 0 and less that 10");
} else {
console.log("Values is less that 0");
}

const marks = 60;

if (marks >= 80) {
console.log("Grade -A ");
} else if (marks >= 70) {
console.log("Grade -B");
} else if (marks >= 60) {
console.log("Grade-C");
} else if (marks >= 50) {
console.log("Grade-D");
} else {
console.log("Grade-F");
}

const subMarks = [30, 70, 40, 56, 65, 44];
let totoalMarks = 0,
passCount = 0,
failCount = 0,
minMarks = 1000,
maxMarks = 0;

for (let i = 0; i < subMarks.length; i++) {
totoalMarks += subMarks[i]; //counting Total Marks

//minMarks
if (minMarks > subMarks[i]) minMarks = subMarks;
//maxMarks
else if (maxMarks < subMarks[i]) maxMarks = subMarks;

//passCount
if (subMarks[i] > 50) {
passCount++;
} else {
//fialCount
failCount++;
}
}

console.log("Totoal Marks ", totoalMarks);
console.log("Number of Subjects Passed ", passCount);
console.log("Number of subjects Failed", failCount);
24 changes: 24 additions & 0 deletions NikhilNama/function.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// function declaration
function add(a, b) {
return a + b;
}

const val = add(10 + 12);
console.log(val);

function welcome(name) {
console.log(`Welocme to Swiggy i++ ${name}`);
}

welcome("Nick");

const arrow = (name) => {
console.log(`This is an arrow function`, name);
};
arrow("Varun");

const anonymous = function () {
console.log("This is an Anonymous Function");
};

anonymous();
12 changes: 12 additions & 0 deletions NikhilNama/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script src="./conditionalStmts.js"></script>
</body>
</html>
1 change: 1 addition & 0 deletions food-app
Submodule food-app added at 19e327