-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
5036 lines (3243 loc) · 102 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
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
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// question 1
// for (let i = 0; i < 5; i++){
// document.write('Hello to the World of Loops <br>')
// }
//question 2
// for (let i = 1; i <= 10; i++){
// console.log(i);
// }
//question 3
// const number = +prompt('Enter any number to write its multiplication table:')
// const length = +prompt('Enter the lenght of multiplication table:')
// if (!isNaN(number) && !isNaN(length)){
// document.write(`<h2>Multiplication Table of ${[number]} </h2>`)
// document.write('<ul>')
// for (let i = 1; i <= length; i++){
// const result = number * i;
// document.write(`<li>${[number]} x ${[i]} = ${[result]} </li>`)
// }
// document.write('</ul>')
// } else {
// document.write(`<h2>Please enter a valid input number</h2>`)
// }
//question 4
// let A = ["Nokia", "Samsung", "Apple", "Sony", "Huawei"];
// for (let i = 0; i < A.length; i++){
// console.log(A[i])
// }
//question 5
// let fruits = ['apple', 'banana', 'mango', 'orange', 'strawberry']
// for (let i = 0; i < fruits.length; i++){
// console.log(fruits[i]);
// }
//question 7
// document.write(`<h2>Counting: </h2>`)
// for (i = 1; i <= 15; i++){
// document.write(`${[i]}, `)
// }
// document.write('<h2>Reverse Counting: </h2>')
// for (let i = 10; i >= 1; i--){
// document.write(`${[i]}, `)
// }
// document.write('<h2>Even: </h2>')
// for (let i = 0; i <= 20; i += 2){
// document.write(`${[i]}, `)
// }
// document.write('<h2>Odd: </h2>')
// for (let i = 1; i <= 19; i += 2){
// document.write(`${[i]}, `)
// }
// document.write('<h2>Series: </h2>')
// for (let i = 2; i <= 20; i += 2){
// document.write(`${[i]}k, `)
// }
//question 9
// let A = [24, 53, 78, 91, 12]
// let largestNum = A[0]
// for (let i = 1; i < A.length; i++){
// if (A[i] > largestNum){
// largestNum = A[i]
// }
// }
// console.log(`The Largest number in the Array is ${[largestNum]}`);
//question 10
// let A = [24, 53, 78, 91, 12]
// let smallestNum = A[0]
// for (let i = 1; i < A.length; i++){
// if (A[i] < smallestNum){
// smallestNum = A[i]
// }
// }
// console.log(`The smallest number in the Array is ${[smallestNum]}`);
//question 11
// let A = [24, 53, 78, 91, 12]
// let largeNum = A[0]
// let SmallNum = A[0]
// for (let i = 1; i < A.length; i++){
// if (A[i] > largeNum){
// largeNum = A[i]
// } else if (A[i] < SmallNum){
// SmallNum = A[i]
// }
// }
// console.log(`The Array is ${[A]}`)
// console.log("The largest number in the array is: " + largeNum)
// console.log("The smallest number in the array is: " + SmallNum)
//question 12
// for (let i = 5; i <= 100; i += 5){
// document.write(`${[i]}, `)
// }
//question 13
// let students = ["Ali", "Abdullah", "Talha", "Ahsan"]
// let scores = [58, 73, 89, 90]
// let table = "<table border='1'><tr><th>Student Name</th><th>Score</th></tr>"
// for ( i = 0; i < students.length; i++){
// table += `<tr><td> ${[students[i]]} </td><td> ${[scores[i]]}</td> </tr>`
// }
// table += '</table>'
// document.write(table)
//question 14
// Given array
// var scores = [12, 45, 3, 22, 34, 50];
// // Ask the user for the stop value
// var stopValue = parseInt(prompt("Enter the stop value:"));
// // Check if the input is a valid number
// if (!isNaN(stopValue)) {
// // Iterate through the array and print numbers until the stop value is reached
// var output = [];
// for (var i = 0; i < scores.length; i++) {
// if (scores[i] <= stopValue) {
// output.push(scores[i]);
// } else {
// break;
// }
// }
// // Print the output
// console.log(output);
// } else {
// // Display an error message if the input is not a valid number
// console.log("Invalid input. Please enter a valid number.");
// }
//question 15
// // Given 2D array
// let A = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
// // Using nested for loops to print each element on a new line
// for (let i = 0; i < A.length; i++) {
// for (let j = 0; j < A[i].length; j++) {
// console.log(A[i][j]);
// }
// }
//question 16
// Ask the user for input
// let num = parseFloat(prompt("Enter a number:"));
// // Check if the input is a valid number
// if (!isNaN(num)) {
// // Repeat and print the value of num while num is positive
// while (num > 0) {
// console.log(num);
// num -= 0.5;
// }
// } else {
// // Display an error message if the input is not a valid number
// console.log("Invalid input. Please enter a valid number.");
// }
//question 17
// Using a for loop to iterate from 0 to 20
// for (let i = 0; i <= 20; i++) {
// // Checking if the current number is even or odd
// if (i % 2 === 0) {
// console.log(i + " is even");
// } else {
// console.log(i + " is odd");
// }
// }
//question 18
// Initialize the product variable with 1
// let product = 1;
// // Iterate from 1 to 7 and multiply odd numbers to the product
// for (let i = 1; i <= 7; i++) {
// if (i % 2 !== 0) {
// product = i;
// }
// }
// // Output the product of odd integers
// console.log("Product of odd integers from 1 to 7: " + product);
//question 19
// // Ask the user for the initial number of stars
// let initialStars = parseInt(prompt("Enter the initial number of stars:"));
// // Check if the input is a valid number
// if (!isNaN(initialStars) && initialStars > 0) {
// // Loop to print lines of stars with decreasing count
// for (let i = initialStars; i > 0; i--) {
// let line = '';
// // Append stars to the line
// for (let j = 0; j < i; j++) {
// line += '*';
// }
// // Print the line of stars
// console.log(line);
// }
// } else {
// // Display an error message if the input is not a valid number
// console.log("Invalid input. Please enter a valid positive number.");
// }
// question 20
// // Ask the user for the number of lines
// let numLines = parseInt(prompt("Enter the number of lines for pattern a:"));
// Create and display pattern a
// for (let i = 0; i < numLines; i++) {
// let line = '';
// for (let j = 0; j < 5; j++) {
// line += '*';
// }
// document.write(line + '<br>');
// console.log(numLines);
// }
// document.write('<br>');
// Create and display pattern b
// for (let i = 1; i <= numLines; i++) {
// let line = '';
// for (let j = 0; j < i; j++) {
// line += '*';
// }
// document.write(line + '<br>');
// }
// document.write('<br>');
// Create and display pattern c
// for (let i = numLines; i > 0; i--) {
// let line = '';
// for (let j = 0; j < i; j++) {
// line += '*';
// }
// document.write(line + '<br>');
// }
// usama
// Create and display pattern c
// for (let i = numLines; i > 0; i--) {
// let line = '';
// for (let j = 0; j < i; j++) {
// line += '*';
// }
// document.write(line + '<br>');
// }
// 9 11 23
// question 20
// // Ask the user for the number of lines
// let numLines = parseInt(prompt("Enter the number of lines for pattern a:"));
// Create and display pattern a
// for (let i = 0; i < numLines; i++) {
// let line = '';
// for (let j = 0; j < 5; j++) {
// line += '*';
// }
// document.write(line + '<br>');
// console.log(numLines);
// }
// document.write('<>');
// Create and display pattern b
// for (let i = 1; i <= numLines; i++) {
// let line = '';
// for (let j = 0; j < i; j++) {
// line += '*';
// }
// document.write(line + '<br>');
// }
// document.write('<br>');
// Create and display pattern c
// for (let i = numLines; i > 0; i--) {
// let line = '';
// for (let j = 0; j < i; j++) {
// line += '*';
// }
// document.write(line + '<br>');
// }
// PRACTICE ;
// Initialize the product variable with 1
// let product = 1;
// // Iterate from 1 to 7 and multiply odd numbers to the product
// for (let i = 1; i <= 7; i++) {
// if (i % 2 !== 0) {
// product *= i;
// }
// }
// // Output the product of odd integers
// console.log("Product of odd integers from 1 to 7: " + product);
// ANOTHER QUESTION ;
// let students = ["Ali", "Abdullah", "Talha", "Ahsan"]
// let scores = [58, 73, 89, 90]
// let table = "<table border='1'><tr><th>Student Name</th><th>Score</th></tr>"
// for ( i = 0; i < students.length; i++){
// table += `<tr><td> ${[students[i]]} </td><td> ${[scores[i]]}</td> </tr>`
// }
// table += '</table>'
// document.write(table)
// ANOTHER QUESTION ;
// document.write(`<h2>Counting: </h2>`)
// for (i = 1; i <= 15; i++){
// document.write(`${[i]}, `)
// }
// document.write('<h2>Reverse Counting: </h2>')
// for (let i = 10; i >= 1; i--){
// document.write(`${[i]}, `)
// }
// document.write('<h2>Even: </h2>')
// for (let i = 0; i <= 20; i += 2){
// document.write(`${[i]}, `)
// }
// document.write('<h2>Odd: </h2>')
// for (let i = 1; i <= 19; i += 2){
// document.write(`${[i]}, `)
// }
// document.write('<h2>Series: </h2>')
// for (let i = 2; i <= 20; i += 2){
// document.write(`${[i]}k, `)
// }
// ANOTHER ONE ;
// Given array
// var scores = [12, 45, 3, 22, 34, 50];
// // Ask the user for the stop value
// var stopValue = parseInt(prompt("Enter the stop value:"));
// // Check if the input is a valid number
// if (!isNaN(stopValue)) {
// // Iterate through the array and print numbers until the stop value is reached
// var output = [];
// for (var i = 0; i < scores.length; i++) {
// if (scores[i] <= stopValue) {
// output.push(scores[i]);
// } else {
// break;
// }
// }
// // Print the output
// console.log(output);
// } else {
// // Display an error message if the input is not a valid number
// console.log("Invalid input. Please enter a valid number.");
// }
// ANOTHER QUES ;
// let A = [24, 53, 78, 91, 12]
// let smallestNum = A[0]
// for (let i = 1; i < A.length; i++){
// if (A[i] < smallestNum){
// smallestNum = A[i]
// }
// }
// console.log(`The smallest number in the Array is ${[smallestNum]}`);
// let A = ["Nokia", "Samsung", "Apple", "Sony", "Huawei"];
// for (let i = 0; i < A.length; i++){
// console.log(A[i])
// }
// ANOTHER ONE ;
// for (let i = 1; i <= 10; i++){
// console.log(i);
// }
// const user = {
// name: 'shahmeer',
// age: '18',
// email: 'shahmeerrizwan921@gmail.com',
// girlfriend:'mere pe tou hai ni'
// }
// console.log(user.girlfriend);
// let complexObject = {
// person: {
// name: {
// first: "John",
// last: "Doe",
// },
// age: 30,
// address: {
// street: {
// number: 123,
// name: "Nested Street",
// },
// city: "Nested City",
// country: "Nested Country",
// },
// },
// work: {
// company: {
// name: "TechCorp",
// location: {
// city: "TechCity",
// country: "TechCountry",
// },
// },
// position: "Senior Developer",
// projects: [
// {
// name: "Project A",
// technologies: ["JavaScript", "React", "Node.js"],
// },
// {
// name: "Project B",
// technologies: ["Python", "Django", ["new" , ["PostgreSQL"]]],
// },
// ],
// },
// hobbies: {
// indoor: ["Reading", "Chess"],
// outdoor: ["Hiking", "Cycling"],
// },
// };
// console.log(complexObject.work.company.location.country);
// console.log(complexObject.work.projects[1].technologies[2][1][0]);
// Ask the user for input
// let num = parseFloat(prompt("Enter a number:"));
// // Check if the input is a valid number
// if (!isNaN(num)) {
// // Repeat and print the value of num while num is positive
// while (num > 0) {
// console.log(num);
// num -= 0.5;
// }
// } else {
// // Display an error message if the input is not a valid number
// console.log("Invalid input. Please enter a valid number.");
// }
// EVENTS ;
// FORM ASSIGNMENT ;
// let form = document.getElementById("form")
// let input = document.getElementById("inp")
// form.addEventListener("submit",function(event){
// form.innerHTML = ('')
// event.preventDefault();
// console.log(input.value);
// input.value= ""
// } )
// BULB ASSIGNMENT ;
// let image = document.getElementById("img");
// image.addEventListener ("mouseover",function(){
// image.src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQcBcfLBk6DAj-4sdPMoPXPkZZ-_J15-LJT6w&usqp=CAU"
// })
// let img = document.getElementById("img");
// image.addEventListener ("mouseout",function(){
// image.src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQRLTClnj-XEF3qqaXMDwbNM4RU40rBVn1lkQ&usqp=CAU"
// })
// ANOTHER ASSIGMNET ;
// HIDE/SHOW PARAGRAPH ;
// function hide() {
// let btn = document.getElementById("btn");
// let para = document.getElementById("para");
// btn.addEventListener("click", function run() {
// if (para.style.display != "none") {
// console.log("if");
// para.style.display = "none";
// btn.innerHTML = 'SHOW'
// } else {
// console.log("else");
// para.style.display = "block";
// btn.innerHTML = "Hide"
// }
// });
// }
// hide();
// 25-11-2023 (ARRAYS);
// let marks_of_class_10 = [12,13,14,15,16,17]
// console.log(marks_of_class_10[1]);
// console.log(marks_of_class_10[2]);
// console.log(marks_of_class_10[3]);
// console.log(marks_of_class_10[4]);
// console.log(marks_of_class_10[5]);
// marks_of_class_10[2] = 69 // array change ;
// console.log(marks_of_class_10);
// ASSIGNMNENT ;
// let marks = [23, 2, 35, 24, "this is the marks of class 12 "];
// for(let i = 0; i < marks.length; i++){
// console.log(marks[i]);
// }
// CREATE AN ARRAY STUDENT NAME WITH MARKS :
// let studentNames = ['SHAHMEER', 'ABDULLAH', 'TALHA', 'ADNAN']; // Create an array with student names
// let studentMarks = [85, 92, 78, 95]; // Create an array with student marks
// for (let i = 0; i < studentNames.length; i++) { // Display student information using a loop
// let name = studentNames[i];
// let marks = studentMarks[i];
// console.log(' CONGRATULATIONS ' + name + ', YOU GOT ' + marks , ' MARKS OUT OF 100 ' );
// let main = document.getElementById('main');
// main.innerHTML += ' CONGRATULATIONS ' + name + ', YOU GOT ' + marks + ' MARKS OUT OF 100 '+ '<br>';
// }
// function
// rishta(20000)
// .then(function (res){
// console.log(res);
// })
// .catch(function(err){
// console.log(err);
// })
// FUNCTIONS PRACTICE :
// const hello = ()=>{
// console.log("hello dude i am fine");
// }
// hello ()
// // EXAMPLE ;
// let a = 1;
// let b = 2;
// let c = 3;
// function oneplus (a,b){
// return 1 + (a / c)
// }
// console.log("sum of a and b is ", oneplus(a, b));
// console.log("sum of a and b is ", oneplus(a, b));
// console.log("sum of a and b is ", oneplus(a, b));
// // EXAMPLE ;
// let marks = {
// shahmeer:90,
// abdullah:87,
// talha:85,
// adnan:76
// }
// for(let i=0;i<marks.lenght;i++){
// console.log("The marks of " +(marks)[i]+ 'are ' + marks[Object.keys(marks)[i]]);
// }
// console.log(marks);
// // EXAMPLE ;
// function sayHello() {
// console.log("Hello, world!");
// }
// sayHello()
// // EXAMPLE ;
// function cube(x) {
// return x + x;
// }
// let result = cube(6);
// console.log(result);
// // EXAMPLE ;
// let sayHelloo = () => {
// console.log("Hello, world!");
// }
// sayHelloo ();
// // EXAMPLE ;
// function cookMaggi(maggi){
// console.log("your maggi will be ready in " + maggi + "minutes" );
// }
// cookMaggi(2);
// EXAMPLE ;
// let a = 12;
// let b = 12;
// sum(a + b);
// let c = 10;
// let d = 10;
// sum( c + d);
// let e = 10;
// let f = 30;
// sum(e + f);
// function sum(a, b){
// let sum = a + b;
// console.log("The Total Result is " , a);
// }
// NESTED FUNCTION ;
// function addSquares(a,b){
// const sa = square(a);
// const sb = square(b);
// function square(num) {
// return num * num;
// }
// return sa + sb;
// }
// console.log(addSquares(90,90));
// ASSIGMNETS ;
// QUESTION NO 1 :
// function sayHello() {
// console.log("Hello, world!")};
// sayHello();
// QUESTION NO 2 :
// let currentDate = new Date();
// console.log(currentDate);
// QUESTION NO 3 :
// function greetUser(firstName,secondName,lastName) {
// let fullName = `${firstName} ${secondName} ${lastName}`;
// return `ASSALAM O ALAIKUM , ${fullName}`;
// }
// const greeting = greetUser("MUHAMMAD", "SHAHMEER", "RIZWAN");
// console.log(greeting);
// QUESTION NO 4 :
// let a = prompt("please enter a first number ");
// let b = prompt("please enter a second number ");
// let c = parseInt(a) + parseInt(b);
// console.log("the sum of " +a+ " and " +b+ " is "+ c );
// QUESTION NO 5 :
// NHI A RAHA
// QUESTION NO 6 :
// let a = prompt("please enter a number ");
// function squareNumber(number) {
// return number * number;
// }
// let squaredResult = squareNumber(a);
// console.log(`The square of ${a} is ${squaredResult}`);
// QUESTION NO 7 :
// let a = prompt("please enter a factorial number ");
// function factorial(number) {
// if (number < 0) {
// return"is less than 0 please enter the number who is greater than 0"
// }
// else {
// let result = 1;
// for (let i = 2; i <= number; i++) {
// result *= i;
// }
// return result;
// }
// }
// let inputNumber = a;
// let result = factorial(a);
// console.log(`The factorial of ${a} is ${result}`);
// const numbers = [33, 2, 8];
// numbers.sort();
// console.log(numbers[1])
// console.log(typeof NaN);
// console.log(false == '0');
// // QUIZ :
// !!~1 // TRUE
// (function () {})() // undefined
// null == undefined
// ~~(-5.5) // -5
// // [1,2,3,4][1,2] // 3
// [[[[[[[22]]]]]]] == 22; // TRUE
// parseInt( null, 24 )=== 23 // TRUE
// ?,,,,? == Array(4) // FALSE
// alert(parseInt(1/0,19)); // 18
// 11. Which of the following is the tainted property of a window object in Java Script?
// C. Defaultstatus
// 13. Which of the following is used to capture all click events in a window?
// A. window.captureEvents(Event.CLICK);
// 14. Javascript is an object oriented language?
//true
// 15. Which of the following is valid JavaScript variable name?
// A. 2java
// 18. ___________ JavaScript is also called client-side JavaScript.
// B. Navigator
// 20. Why so Java and JavaScript have similar name?
// B. The syntax of JavaScript is loosely based on Java syntax
// 21. File is a server-side JavaScript object?
// A. True
// 22. What is the alternate name for Java script?
// D. ECMAScript
// 28. Java Script supports all boolean operators
// B. False
// 29. Java Script entities start with ____________ and end with ______________
// D. Ampersand, semicolon
// 12. Which attribute needs to be changed to make elements invisible?
// B. visible
// 17. What is negative infinity in Java script?
// D. number in JavaScript, derived by dividing negative number by zero
// 24. What java wrapper type is created when a JavaScript object is sent to Java?
// A. ScriptObject
// 27. Which of the following method is used to evaluate a string of Java Script code in the context of the specified object?
// A. Eval
// FUNCTIONS QUESTIONS ;
// function displayDate() {
// document.getElementById('showdate').innerHTML = Date();
// Date()
// }
// FUNCTIONS ;
// function greetUser(firstName,secondName,lastName) {
// let fullName = `${firstName} ${secondName} ${lastName}`;
// return `ASSALAM O ALAIKUM , ${fullName}`};
// const greeting = greetUser("MUHAMMAD", "SHAHMEER", "RIZWAN");
// console.log(greeting);
// NEXT QUESTION :
// let a = prompt("please enter a first number ");
// let b = prompt("please enter a second number ");
// let c = parseInt(a) + parseInt(b);
// console.log("the sum of " +a+ " and " +b+ " is "+ c );
// ANOTHER QUESTION
// let str = prompt('enter any string');
// function palindrome (str){
// console.log(str.split('').reverse().join(''));
// if(str.split('').reverse().join('') ===str){
// console.log('this is palindrome');
// }else{
// console.log('this is not palindrome');
// }
// }
// palindrome(str);
// ANOTHER QUESTION
// let str = prompt('enter any sentence');
// function abc(str) {
// let convertArr = str.split(' ');
// const arr = []
// for (let i = 0; i < convertArr.length; i++) {
// // console.log(convertArr[i]);
// let converted = convertArr[i].charAt(0).toUpperCase() + convertArr[i].slice(1);
// arr.push(converted)
// }
// return arr.join(' ');
// }
// console.log(abc(str));
// ANOTHER QUESTION :
// function celsiusToFahrenheit() {
// let c = prompt('Enter number , centigrade into fahrenheits ')
// let f = (c * 9 / 5) + 32
// console.log(`${c}°C is ${f}°F`);
// }
// celsiusToFahrenheit()
// var originalNum = 23;
// var numToBeAdded = 7;