-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday1.js
More file actions
308 lines (217 loc) · 7.36 KB
/
day1.js
File metadata and controls
308 lines (217 loc) · 7.36 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
// i can make notes like this in js and C and C++
// console.log('Hello'); // to log something on the console
// console.log("I hate nigger"); // to log something on the console
// // window.alert('I am an alert'); // to creat an alert
// // window.alert('I hate niggers'); // to creat an alert
// // this is a command
// /*
// this is a
// comment
// */
// document.getElementById('Hello').textContent = 'Hello World';
// document.getElementById('MyPenis').textContent = 'I hate niggers';
// let x = 100;
// console.log(x);
// let y;
// let age = 25;
// let price = 10.99;
// let gpa = 2.1;
// console.log(typeof price);
// console.log(`You are ${age} years old`); // ${} is like f strings in python
// console.log(`the price is $${price}`);
// console.log(`Your gpa is: ${gpa}`);
// let firstName = `Nigger`
// let favFod = 'KFC+Watermelon'
// let email = 'nigger1@gmail.com'; // can't use string from the nigger 1 to do maath
// console.log(`your name is ${firstName}`);
// console.log(`you like child and your favorite food is: ${favFod}`);
// console.log(`Your email is ${email}`)
// let gender = false; console.log(`${gender}`)
// console.log(typeof gender)
// if (gender === false){ // we use 3 to check type and value
// console.log(`You are a woman`)
// }
// else if (gender === true){
// console.log(`You are a man`)
// }
// let students = 30;
// students = students + 1; // to add 1 to the current like in python +=
// students = students - 1; // to remove 1 like in python
// students = students * 2; // tis multiplys
//students = students / 2; // this bassicly devides students by 2
//students = students **2; // this gives the powerr of 2 so négyzet in hungaarian
// let Extrastudents = students % 3; // modulus operator
// console.log(students);
// students += 1; // FUCKING EASIER THEN DOING THE WHOLE = AND = SHIT btw this gives + = 1 plush eaqucls 1
// students -= 1; // FUCKING EASIER THEN DOING THE WHOLE = AND = SHIT btw this gives - = 1 minus eaqucls 1
// students *= 2;
//students /= 2; // this devides by 2
//students **= 2; // this gives the powerr of 2 so négyzet in hungaarian
// students %= 2; // modulus
// students++; // this increments so it only adds one its called increment operator
// students--; // this called decrement operaator so it removes 1 from current
// console.log(students);
/*
Operator precedence
1 parathethis ()
2 exponents
3 multiplication & division & modulo
4 addition & substration
in hungarian Müveletek sorendje
*/
// let result = 1 + 2 * 3 + 4 ** 2;
// let result = 12 % 5 + 8 / 2;
// let result = 6 / 2 ** (2 + 5);
// console.log(result);
// let username;
// let password;
// let gender = "";
// // username = window.prompt(`Whats your username?`); Easy way
// // console.log(username);
// document.getElementById(`mySubmit`).onclick = function(){
// username = document.getElementById(`myText`).value;
// console.log(username);
// document.getElementById(`Header1`).textContent = `Hello ${username}`;
// }
// const input = document.querySelectorAll("input")
// const inputValue = input.value;
// console.log(inputValue);
// document.getElementById(`SBFORM`).onclick = function(){
// const selectedGender = document.querySelector('input:checked').value;
// console.log(selectedGender);
// }
// let age = window.prompt("how old are you?");
// age = Number(age); // data type we can change it here to a number
// age+=1;
// console.log(age, typeof age); // it will say its a number type since we changed it
// let x ;
// let y ;
// let z ;
// x = Number(x);
// y = String(y);
// z = Boolean(z);
// console.log(x,typeof x, y, typeof y,z, typeof z);
// const PI = 3.14159; // no variabls can be changed so like touple
// let radius;
// let circumference;
// document.getElementById("mySubmit").onclick = function(){
// radius = document.getElementById("myText").value;
// radius = Number(radius);
// circumference = 2 * PI * radius;
// document.getElementById("myH3").innerHTML = circumference
// }
// const decraseBtn = document.getElementById("decreaseBtn");
// const resetBtn = document.getElementById("resetBtn");
// const increaseBtn = document.getElementById("increaseBtn");
// const countLabel = document.getElementById("countLabel");
// let count = 0;
// increaseBtn.onclick = function(){
// count++;
// countLabel.textContent = count;
// }
// decraseBtn.onclick = function(){
// count--;
// countLabel.textContent = count;
// }
// resetBtn.onclick = function(){
// count = 0;
// countLabel.textContent = count;
// }
// const btns = document.getElementsByClassName("btns");
// const myText = document.getElementById("myText");
// const min = 10;
// const max = 30;
// let randomNum;
// console.log(randomNum)
// for(let btn of btns){
// btn.onclick = function(){
// randomNum = Math.floor(Math.random() * (max - min)) + min;
// myText.value = randomNum;
// }
// }
// let x = 3;
// let y = 2;
// let z = 1;
// // z = Math.round(x); // it will always round like normally
// // z = Math.floor(x); // it will walys round down
// // z = Math.ceil(x); // it will awlays round up
// // z = Math.trunc(x);
// // z = Math.pow(x,y)
// // z = Math.sqrt(81); // 9
// // z = Math.log(x);
// // z = Math.sin(x);
// // z = Math.cos(x);
// // z = Math.tan(x);
// // z = Math.random(x);
// // z = Math.abs(x);
// // console.log(z);
// let max = Math.max(x,y,z)
// console.log(max)
// let min = Math.min(x,y,z)
// console.log(max)
// console.log(z);
// let age = 17;
// if(age >= 18){
// console.log("You are old enoguh to enter this site");
// }
// else if(age < 18){
// console.log("you can't enter this site nigga");
// }
// else{
// console.log("HELP");
// }
// let time = 4;
// if(time < 12){
// console.log("Good morning!")
// }
// else{
// console.log("Good afternoon!")
// }
// let isStudent = true;
// if(isStudent){
// console.log("YOu are a student");
// }
// else{
// console.log("You are not a student");
// }
// let age = 20;
// let hasLicense = true;
// if(age >= 16){
// console.log("You are old enough to drive ");
// if(hasLicense){
// console.log("You have a license and you can drive");
// }
// else{
// console.log("YOu don't have a license but you can get one");
// }
// }
// else{
// console.log("You must be 16+ to have a license")
// }
const myCheckBox = document.getElementById("myCheckBox");
const visaBtn = document.getElementById("visaBtn");
const masterCardBtn = document.getElementById("masterCardBtn");
const payPalBtn = document.getElementById("payPalBtn");
const mySubmit = document.getElementById("mySubmit");
const subResult = document.getElementById("subResult");
const paymentResult = document.getElementById("paymentResult");
mySubmit.onclick = function(){
if(myCheckBox.checked){
subResult.textContent = `You are subscribed!`;
}
else{
subResult.textContent = `You are not subscribed!`;
}
if(visaBtn.checked){
paymentResult.textContent = `You Are paying with Visa`;
}
else if(masterCardBtn.checked){
paymentResult.textContent = `You Are paying with MasterCard`;
}
else if(payPalBtn.checked){
paymentResult.textContent = `You Are paying with Paypal`;
}
else{
paymentResult.textContent = `You must select a payment type`;
}
}