Skip to content

Added my assignments #17

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

Open
wants to merge 1 commit into
base: master
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
14 changes: 14 additions & 0 deletions HTML/Closestpower.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Closest power of 2 </title>
<script src="../js/closestPower.js"></script>
</head>
<body>
<div>
Enter Number : <input name="sum" id= "sum" />
<button onclick="closestPower()">Closest Power of 2</button>
</div>
</body>
</html>
14 changes: 14 additions & 0 deletions HTML/Factorial.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Factorial Calculation</title>
<script src="../js/factorial.js"></script>
</head>
<body>
<div>
Enter Number : <input name="fct" id= "fct" />
<button onclick="factorial()">Factorial</button>
</div>
</body>
</html>
14 changes: 14 additions & 0 deletions HTML/ListOfPairs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Sum of pairs equal to 8</title>
<script src="../js/listOfPairs.js"></script>
</head>
<body>
<div>
Enter Number : <input name="sum" id= "sum" />
<button onclick="listOfPairs()">List of pairs</button>
</div>
</body>
</html>
14 changes: 14 additions & 0 deletions HTML/Multiples.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Replacing Multiples with String</title>
<script src="../js/multiples.js"></script>
</head>
<body>
<div>
Enter Number : <input name="sum" id= "sum" />
<button onclick="multiples()">Result</button>
</div>
</body>
</html>
13 changes: 13 additions & 0 deletions HTML/PalindromeList.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Palindrome Test</title>
<script src="../js/palindromeTest.js"></script>
</head>
<body>
<div>
<button onclick="palindromeList()">Palindrome Or Not </button>
</div>
</body>
</html>
14 changes: 14 additions & 0 deletions HTML/PalindromeTest.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Palindrome Test</title>
<script src="../js/palindromeTest.js"></script>
</head>
<body>
<div>
Enter String Value :<input id="str"/>
<button onclick="palindromeTest()">Palindrome Or Not </button>
</div>
</body>
</html>
51 changes: 51 additions & 0 deletions HTML/ReadMe.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Git Configurations for adding username and Mail id

git config --global user.name "Sam Smith"
git config --global user.email [email protected]

Command for Git Initialization :
git init




Git SSL certificates Validation Command:

git config http.sslVerify "false"


Git Push command

git remote add origin https://github.com/vijayella/AngularJS.git
git remote add origin https://github.com/vijayella/Angular-Training
git push -u origin master


For cloning the Git hub after disabling the SSl certificates :

git config --global http.sslVerify false
git clone https://github.com/vijayella/Angular-Training.git <<Git Hub URL>>

Changing the branch

Git checkout

Commiting to the git

git commit -m "Message that describing the git commit"



INstalling Node Package Manager.

node -v
npm -v

npm install - g typescript
npm install -g @angular/cli






13 changes: 13 additions & 0 deletions HTML/Repeated_Numbers_List.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Repeated Numbers</title>
<script src="../js/repeatedNumbers.js"></script>
</head>
<body>
<div>
<button onclick="repeatedNumbers()">List of repeated numbers </button>
</div>
</body>
</html>
13 changes: 13 additions & 0 deletions HTML/SumPaid.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Sum Paid</title>
<script src="../js/totalSumPaid.js"></script>
</head>
<body>
<div>
<button onclick="totalSumPaid()">Total Sum Paid </button>
</div>
</body>
</html>
14 changes: 14 additions & 0 deletions HTML/Sum_Natural_No.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Sum of natural numbers</title>
<script src="../js/sum.js"></script>
</head>
<body>
<div>
Enter Number : <input name="sum" id= "sum" />
<button onclick="sum()">Sum</button>
</div>
</body>
</html>
14 changes: 14 additions & 0 deletions HTML/SumofMultiples.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Sum of Multiples of 3 or 5</title>
<script src="../js/sumOfMultiples.js"></script>
</head>
<body>
<div>
Enter Number : <input name="sum" id= "sum" />
<button onclick="sumOfMultiples()">Sum Of multiples of 3 Or 5</button>
</div>
</body>
</html>
17 changes: 17 additions & 0 deletions JS/closestPower.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
function closestPower(){
var result=0;
var num= document.getElementById("sum").value;
if(num)
{
document.write("Closest Power of 2 below "+ num +" is : ");


result = Math.pow( 2, Math.floor( Math.log( num ) / Math.log( 2 ) ) );

document.write(result);
}
else{
alert("Enter valid number");

}
}
15 changes: 15 additions & 0 deletions JS/factorial.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
function factorial(){
var result=1;
var num= document.getElementById("fct").value;
if(num)
{
for(i=1;i<=num;i++){
result=result*i;
}
document.write(result);
}
else{
alert("Enter valid number");

}
}
22 changes: 22 additions & 0 deletions JS/listOfPairs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
function listOfPairs(){
var sum = document.getElementById("sum").value;
var list = [1, 4, 3, 5, 4, 6, 7, 8, 3];
if(sum)
{
document.write("Pairs whoose sum equal to 8 in the given List is : </br>");
for(i=0;i<=list.length-1;i++)
{
for(j=i+1;j<=list.length-1;j++){
if(list[i]+list[j]==sum)
{
document.write("\"" +list[i]+","+list[j]+ "\""+ "</br>")
}
}

}
}
else{
alert("Enter valid number");

}
}
37 changes: 37 additions & 0 deletions JS/multiples.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
function multiples(){
var result=0;
var num= document.getElementById("sum").value;
if(num)
{

for(i=1;i<=num;i++)
{
if(i%3==0 && i%5==0)
{
document.write('FizzBuzz,');

}
else if(i%3==0)
{
document.write('Fizz,');
}
else if(i%5==0)
{
document.write('Buzz,');
}
else{
if(i==num)
{
document.write(i);
}
else{
document.write(i+",");
}
}
}
}
else{
alert("Enter valid number");

}
}
59 changes: 59 additions & 0 deletions JS/palindromeTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
function palindromeTest(){
var inputString = document.getElementById("str").value;
var res="";
if(inputString)
{
res = isPalindrome(inputString);
document.write("</br> <strong>" +res +"</strong>");
}
else
{
alert("Enter valid String");
}
//res = (Object.values(list));
//document.write("Values of the list is : "+res +"</br>");
}


function isPalindrome(param){
var Palindrome=false;
var result = param.split('').reverse().join('');
//document.write("Result String after reverse is :" +result);
if(param==result)
{
Palindrome=true;
return Palindrome;
//document.write("</br> <strong>" +Palindrome +"</strong>");
}
else {
return Palindrome;
//document.write("</br> <strong>" +Palindrome +"</strong>");

}
}


/* Function to test the palindrome strings in an array */

function palindromeList()
{
var list = ["malayalam", "tree", "boat", "civic", "melt", "level"];
var res=[];
var listString="";
var result = true;
for(i=0;i<=list.length-1;i++)
{
listString = list[i];
alert(listString);
result = isPalindrome(listString);
if(result)
{
//alert("in loop");
res.push(listString);
}

}

document.write("Result Array is : "+res);

}
Loading