-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
100 lines (62 loc) · 1.7 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// var a = prompt("Enter your name")
// alert(a.toUpperCase())
// alert(a.toLowerCase())
// var a = prompt("Enter your Phone Model")
// alert(a.length)
// var b = a.charAt(a.length-1)
// alert(b)
// var a = "Pakistani"
// var b = a.indexOf("n")
// alert(b)
// var a = prompt("Enter user name")
// if(a != "@" && a != "!" && a != "$" && a != "," && a != "." ){
// prompt(" ","invalid username")
// }
// var a = "The quit brown fox jumps over the lazy dog"
// var b=1
// for(var i=1;i<=a.length;i++){
// if(i=="the"||i=="The"){
// b+=i
// }
// }
// console.log(b)
// var a = "Pakistani"
// alert(a.charAt("3"))
// var a = "Hyderabad"
// alert(a.replace("Hyder","Islam"))
// var message = "Ali and Sami are best friends. They play cricket and football together.";
// var b = message.replace(/and/g, "&")
// alert(b)
// var n = 3.4512;
// console.log("Number "+n+"\nRound off #"+Math.round(n)+"\nFloor #"+Math.floor(n)+"\nCeil #"+Math.ceil(n))
// var n = -2.678;
// console.log("Number "+n+"\nRound off #"+Math.round(n)+"\nFloor #"+Math.floor(n)+"\nCeil #"+Math.ceil(n))
// var dice = 1
// for(var i=1;i<=6;i++){
// dice+=Math.round(Math.random())
// if(dice > 6){
// dice = 1
// dice+=Math.round(Math.random()+i)
// }
// }
// console.log(dice)
// var n = Math.round(Math.random()+1)
// if(n==2){
// console.log("Head")
// }
// else{
// console.log("Tail")
// }
// var n = "50.2kg"
// var a = parseFloat(n)
// console.log(a)
// var n = "427"
// var a = parseInt(n)
// console.log(a)
// console.log(typeof a)
// var n = 35.36
// var a = n.toString()
// var replace = a.replace(".","")
// console.log(replace)
var per = 30/45*100
console.log(per.toFixed(2))