PageRenderTime 6ms CodeModel.GetById 2ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/King Xiong/obj/Debug/Package/PackageTmp/Views/Home/Portfolio.cshtml

https://bitbucket.org/kingxiong/blogpostproject
Razor | 690 lines | 558 code | 79 blank | 53 comment | 38 complexity | 036460ea9a6a3cfff630243c9017c886 MD5 | raw file
  1
  2@{
  3    ViewBag.Title = "Portfolio";
  4}
  5<body>
  6    <section>
  7        <h2 class=" container section-heading text-center">Project Exercise</h2>
  8        <div class="container text-center">
  9            <div class="row">
 10                <div class="col-md-12 ">
 11                    <h3>JavaScript Exercise</h3>
 12                        <img src="~/Library/Template/img/5.jpg" class="btn page-scroll" data-toggle="modal" data-target="#series" title="5 Number Series" style="max-height:250px; max-width: 250px">
 13                        <img src="~/Library/Template/img/Factorial.jpeg" class="btn page-scroll" data-toggle="modal" data-target="#factorialMod" title="Factorial" style="max-height:250px; max-width: 250px">
 14                        <img src="~/Library/Template/img/FizzNBuzz.png" class="btn page-scroll" data-toggle="modal" data-target="#fizzbuzz" title="Fizz and Buzz" style="max-height:250px; max-width: 250px">
 15                        <img src="~/Library/Template/img/Palindrome.png" class="btn page-scroll" data-toggle="modal" data-target="#palindrome" title="Palindrome" style="max-height:250px; max-width: 250px">                       
 16                    <h3>C# Exercise</h3>
 17                        <a href="" class="btn btn-primary btn-xl page-scroll btn-shape" data-toggle="modal" data-target="#cSeries" style="width:245.55px">5 Series of Numbers</a>
 18                        <a href="" class="btn btn-primary btn-xl page-scroll btn-shape" data-toggle="modal" data-target="#cFactorial" style="width:245.55px">Factorial</a>
 19                        <a href="" class="btn btn-primary btn-xl page-scroll btn-shape" data-toggle="modal" data-target="#cFizzBuzz" style="width:245.55px">Fizz and Buzz</a>
 20                        <a href="" class="btn btn-primary btn-xl page-scroll btn-shape" data-toggle="modal" data-target="#cPalindrome" style="width:245.55px">Palindrome</a>
 21                </div>
 22            </div>
 23        </div>
 24        <br />
 25    </section>
 26
 27    <!-- Modal for JS 5 Series program -->
 28    <div class="modal fade" id="series" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
 29        <div class="modal-dialog modal-lg">
 30            <div class="modal-content">
 31                <div class="modal-header">
 32                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
 33                    <h1 class="modal-title" id="myModalLabel"><font color="black">5 Series</font></h1>
 34                </div>
 35                <!--5 series Html Code for output-->
 36                <!-- class="modal-body col-*-*" is important for organization -->
 37                <div class="modal-body col-sm-12">
 38                    <!--My functions-->
 39                    <h4 style="color:black">Write a program that accepts a series of at least 5 numbers from the user and performs the follwing actions:</h4>
 40                    <h4 style="color:black">a. Determine which number is the least</h4>
 41                    <h4 style="color:black">b. Determine which number is the greatest</h4>
 42                    <h4 style="color:black">c. Determine the mean of the numbers</h4>
 43                    <h4 style="color:black">d. Determine the sum of all the numbers</h4>
 44                    <h4 style="color:black">e. Determine the product of all the numbers</h4>
 45                    <div class="row">
 46                        <!--Rows before Column-->
 47                        <div class="col-md-2">
 48                            <!--Trying to config two columns, 1 column is for input(submitting numbers), the other is for output(result)-->
 49                            <form>
 50                                <!--Form tag is for boxes to input materials-->
 51                                <div class="form-group">
 52                                    <!--Form-group is to group all the labels & input into each separate row (only for bootstrap)-->
 53                                    <input type="number" id="firstNumber" name="firstNumber" class="form-control" placeholder="First Number" />
 54                                    <!--Form-control enables the uses of bootstrap--><!--id="firstNumber" is unique-->
 55                                </div>
 56                                <div class="form-group">
 57                                    <input type="number" id="secondNumber" name="secondNumber" class="form-control" placeholder="Second Number" />
 58                                    <!--id="secondNumber" is unique-->
 59                                </div>
 60                                <div class="form-group">
 61                                    <input type="number" id="thirdNumber" name="thirdNumber" class="form-control" placeholder="Third Number" />
 62                                    <!--id="thirdNumber" is unique-->
 63                                </div>
 64                                <div class="form-group">
 65                                    <input type="number" id="fourthNumber" name="fourthNumber" class="form-control" placeholder="Fourth Number" />
 66                                    <!--id="fourthNumber" is unique-->
 67                                </div>
 68                                <div class="form-group">
 69                                    <input type="number" id="fifthNumber" name="fifthNumber" class="form-control" placeholder="Fifth Number" />
 70                                    <!--id="fifthNumber" is unique-->
 71                                </div>
 72                            </form>
 73                            <button id="calculate" type="submit" class="btn btn-block" value="Run">Calculate</button>
 74                            <!--id="calculate" is unique in HTML-->
 75                        </div>
 76                        <div class="col-md-2">
 77                            <!--The second column with width of 6-->
 78                            <div class="form-group">
 79                                <label>Least:</label>
 80                                <label id="least"></label>
 81                            </div>
 82                            <div class="form-group">
 83                                <label>Greatest:</label>
 84                                <label id="greatest"></label>
 85                            </div>
 86                            <div class="form-group">
 87                                <label>Mean:</label>
 88                                <label id="mean"></label>
 89                            </div>
 90                            <div class="form-group">
 91                                <label>Sum:</label>
 92                                <label id="sum"></label>
 93                            </div>
 94                            <div class="form-group">
 95                                <label>Product:</label>
 96                                <label id="product"></label>
 97                            </div>
 98                        </div>
 99                        <div class="col-md-8">
100                            <pre class="brush: js">
101                                $(document).ready(function () {
102                                    $("#calculate").click(function (event) {
103                                        event.preventDefault();
104                                    });
105                                });
106
107                                $("#calculate").click(calculateNumbers);
108
109                                function calculateNumbers() {
110
111                                    //input
112                                    var firstValue = parseInt($("#firstNumber").val());
113                                    //parseInt is converting input as an integer value instead of a text value
114                                    var secondValue = parseInt($("#secondNumber").val());
115                                    // $("#secondNumber") is using jquery to test if id="secondNumber" is a integer value.
116                                    var thirdValue = parseInt($("#thirdNumber").val());
117                                    var fourthValue = parseInt($("#fourthNumber").val());
118                                    var fifthValue = parseInt($("#fifthNumber").val());
119
120                                    //Processing 
121                                    //inputing the variable min to be Math.min( , , , , ) 
122                                    //min
123                                    var min = Math.min(firstValue, secondValue, thirdValue, fourthValue, fifthValue);
124                                    //max
125                                    var max = Math.max(firstValue, secondValue, thirdValue, fourthValue, fifthValue);
126                                    //sum
127                                    var add = firstValue + secondValue + thirdValue + fourthValue + fifthValue;
128                                    //product
129                                    var numArray = [firstValue, secondValue, thirdValue, fourthValue, fifthValue];
130                                    var multiplication = 1;
131                                    for (i = 0; i < numArray.length; i++)
132                                    {
133                                        multiplication *= numArray[i];
134                                    }
135
136                                    /* Simplier version
137                                    var multiplication = firstValue * secondValue * thirdValue * fourthValue * fifthValue;
138                                    */
139
140                                    //mean
141                                    var mean = add / numArray.length;
142
143                                    //output
144                                    $("#least").html(min);
145                                    $("#greatest").html(max);
146                                    $("#mean").html(mean);
147                                    $("#sum").html(add);
148                                    // id="sum" exist in HTML, but .html(add) exist in var add in JavaScript
149                                    $("#product").html(multiplication);
150
151                                };
152                            </pre>
153                        </div>
154                    </div>
155                    <!--End of 5 series function -->
156                </div>
157                <div class="modal-footer no-margin">
158                </div>
159            </div>
160        </div>
161    </div>
162    <!--End of Modal for 5 Series exercise-->
163    <!-- Modal for JS Factorial project -->
164    <div class="modal fade" id="factorialMod" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
165        <div class="modal-dialog modal-lg">
166            <div class="modal-content">
167                <div class="modal-header">
168                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
169                    <h1 class="modal-title" id="myModalLabel"><font color="black">Factorial</font></h1>
170                </div>
171                <!--Factorial Html Code for output-->
172                <div class="modal-body col-sm-12">
173                    <div class="row" style="color:black">
174                        <div class="col-lg-2">
175                            <h2>Input your number</h2>
176                            <form>
177                                <div class="form-group">
178                                    <input type="number" id="factorialNumber" name="factorialNumber" class="form-control" placeholder="Number" />
179                                    <button id="factorialCalculate" type="submit" class="btn btn-block">Calculate</button>
180                                </div>
181                            </form>
182                        </div>
183                        <div class="col-lg-2">
184                            <label>Factorial:</label><br />
185                            <label id="factorial"></label>
186                        </div>
187
188                        <div class="col-lg-8">
189                            <pre class="brush: js">
190                                $(document).ready(function () {
191                                    $("#factorialCalculate").click(function (event) {
192                                        event.preventDefault();
193                                    });
194                                });
195
196
197                                $("#factorialCalculate").click(calculateFactorial);
198
199                                function calculateFactorial() {
200
201                                    //input variables
202                                    var factorialFunction = 1;
203                                    var inputNum = parseInt($("#factorialNumber").val());
204
205                                    //process
206                                    for (i = inputNum; i > 0; i--) {
207                                        factorialFunction *= i;
208                                    }
209
210                                    //output
211                                    $("#factOutput").html(factorialFunction);
212                                }
213                            </pre>
214                        </div>
215                    </div>
216                </div>
217                <!--End of 5 series function -->
218                <div class="modal-footer no-margin">
219                </div>
220            </div>
221        </div>
222    </div>
223    <!-- End of modal for Factorial exercise -->
224    <!-- Modal for JS Fizz and Buzz-->
225    <div class="modal fade" id="fizzbuzz" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
226        <div class="modal-dialog modal-lg">
227            <div class="modal-content">
228                <div class="modal-header">
229                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
230                    <h1 class="modal-title" id="myModalLabel"><font color="black">Fizz and Buzz</font></h1>
231                </div>
232                <!--Fizz and Buzz Html Code for output-->
233                <div class="modal-body col-sm-12">
234                    <div class="row" style="color:black">
235                        <div class="col-lg-3">
236                            <h1>Fizz And Buzz</h1>
237                            <form>
238                                <div class="form-group">
239                                    <input type="number" min="1" max="100" id="first" class="form-control" placeholder="Enter the first number" />
240                                    <input type="number" min="1" max="100" id="second" class="form-control" placeholder="Enter the second number" />
241                                    <button id="solve" type="submit" class="btn btn-block">Solve</button>
242                                </div>
243                            </form>
244                        </div>
245                        <div class="col-lg-2" id="answers-scroll">
246                            <label>Result:</label><br />
247                            <label id="result"></label>
248
249                        </div>
250                        <div class="col-lg-7">
251                            <pre class="brush: js">
252                                $(document).ready(function () {
253                                    $("#solve").click(function (event) {
254                                        event.preventDefault();
255                                    });
256                                });
257
258                                $("#solve").click(computing);
259
260                                function computing() {
261                                    var inputOne = parseInt($("#first").val());
262                                    var inputTwo = parseInt($("#second").val());
263                                    var numArray = [];
264
265                                    ////adding 1-100 into numArray
266                                    for (i = 1; i <= 100; i++)
267                                    {
268                                       numArray.push(i);
269                                    }
270
271                                    //indexing
272                                    for (j = 0; j < 100; j++)
273                                    {
274        
275                                        if (numArray[j] % inputOne === 0 && numArray[j] % inputTwo === 0) {
276                                            $("#result").append("Fizz&Buzz");
277                                        }
278                                        else if (numArray[j] % inputOne === 0) {
279                                            $("#result").append("Fizz");
280                                        }
281                                        else if (numArray[j] % inputTwo === 0) {
282                                            $("#result").append("Buzz");
283                                        } else {
284                                            $("#result").append(numArray[j]);
285                                        }
286                                            $("#result").append("<br>")
287                                    }         
288                                 };
289                                </pre>
290
291                        </div>
292                    </div>
293                </div>
294
295                <!--End of Fizz and Buzz function -->
296                <div class="modal-footer no-margin">
297                </div>
298            </div>
299        </div>
300    </div>
301    <!-- End of modal for Fizz And Buzz exercise -->
302    <!-- Modal for JS Palindrome-->
303    <div class="modal fade" id="palindrome" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
304        <div class="modal-dialog modal-lg">
305            <div class="modal-content">
306                <div class="modal-header">
307                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
308                    <h1 class="modal-title" id="myModalLabel"><font color="black">Palindrome</font></h1>
309                </div>
310                <!-- Palindrome Html Code for output-->
311                <div class="modal-body col-sm-12">
312                    <div class="row" style="color:black">
313                        <div class="col-lg-5">
314                            <h2>Please enter a word.</h2>
315                            <h2>This program will check if it is a Palindrome word.</h2>
316                            <form>
317                                <div class="form-group">
318                                    <!--form-group groups anything in forms into separate boxes-->
319                                    <input type="text" id="inputWord" class="form-control" placeholder="Palindrome Word" />
320                                    <button id="confirmPal" type="submit" class="btn btn-block">Solve</button>
321                                </div>
322                            </form>
323                            <div>
324                                <label>Outcome:</label>
325                                <label id="outcome"></label>
326                            </div>
327                            <!-- End of Palindrome function -->
328                        </div>
329                        <div class="col-lg-7">
330                            <pre class="brush: js">
331                                $(document).ready(function () {
332                                    $("#confirmPal").click(function (event) {
333                                        event.preventDefault();
334                                    });
335                                });
336
337                                $("#confirmPal").click(computing);
338
339                                function computing() {
340
341                                    //declares variable input
342                                    //.val() is a method in jQuery used to put value in an object.
343                                    var inputWord = $("#inputWord").val();
344                                    var theText = [];
345
346                                    //computing the results
347                                    for (j = 0; j <= inputWord.length - 1; j++) {
348                                        //setting the array theText to be the same as each individual character from the inputed word.
349                                        theText[j] = inputWord.charAt(j);
350                                    }
351
352                                    theText.reverse();
353                                    //theText.reverse() converts the inputed word around
354                                    var oppText = theText.join("");
355                                    //oppText changes the theText.join("") into the array with no commas in between
356                                    //example (["a","f","t","e","r"] ==> "after")
357
358                                    //output
359                                    if (inputWord === oppText) {
360                                        $("#outcome").html("It is a palindrome");
361                                    } else if (theText !== oppText) {
362                                        $("#outcome").html("It is not a palindrome");
363                                    }
364
365                                  }
366
367                            </pre>
368                        </div>
369                    </div>
370                </div>
371                <div class="modal-footer no-margin">
372                </div>
373
374            </div>
375        </div>
376    </div>
377    <!-- End  of modal for Palindrome exercise -->
378    <!-- C# modal for 5 Series -->
379    <div class="modal fade" id="cSeries" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
380        <div class="modal-dialog modal-lg">
381            <div class="modal-content">
382                <div class="modal-header">
383                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
384                    <h1 class="modal-title" id="myModalLabel"><font color="black">5 Series C#</font></h1>
385                </div>
386
387
388                <!--5 series C# code-->
389
390                <div class="modal-body col-sm-12">
391                    <!--My functions-->
392                    <h4 style="color:black">Write a program that accepts a series of at least 5 numbers from the user and performs the follwing actions:</h4>
393                    <h4 style="color:black">a. Determine which number is the least</h4>
394                    <h4 style="color:black">b. Determine which number is the greatest</h4>
395                    <h4 style="color:black">c. Determine the mean of the numbers</h4>
396                    <h4 style="color:black">d. Determine the sum of all the numbers</h4>
397                    <h4 style="color:black">e. Determine the product of all the numbers</h4>
398                    <div class="row">
399                        <!--Rows before Column-->
400                        <div class="col-md-12">
401                            <pre class="brush: csharp">
402                                using System;
403                                using System.Collections.Generic;
404                                using System.Linq;
405                                using System.Text;
406                                using System.Threading.Tasks;
407
408                                namespace _5_Series
409                                {
410                                    class Program
411                                    {
412                                        static void Main(string[] args)
413                                        {
414                                            double first, second, third, fourth, fifth, minNumber, maxNumber, sum, product, mean;
415                                            string firstInput, secondInput, thirdInput, fourthInput, fifthInput;
416
417                                            Console.WriteLine("Enter your first number");
418                                            firstInput = Console.ReadLine();
419                                            first = double.Parse(firstInput);
420
421                                            Console.WriteLine("Enter your second number");
422                                            secondInput = Console.ReadLine();
423                                            second = double.Parse(secondInput);
424
425                                            Console.WriteLine("Enter your third number");
426                                            thirdInput = Console.ReadLine();
427                                            third = double.Parse(thirdInput);
428
429                                            Console.WriteLine("Enter your fourth number");
430                                            fourthInput = Console.ReadLine();
431                                            fourth = double.Parse(fourthInput);
432
433                                            Console.WriteLine("Enter your fifth number");
434                                            fifthInput = Console.ReadLine();
435                                            fifth = double.Parse(fifthInput);
436
437                                            double[] numberArray = { first, second, third, fourth, fifth };
438                                            maxNumber = numberArray.Max();
439                                            minNumber = numberArray.Min();
440                                            sum = first + second + third + fourth + fifth;
441                                            product = first * second * third * fourth * fifth;
442                                            mean = sum / numberArray.Length;
443
444                                            Console.WriteLine("Max " + maxNumber);
445                                            Console.WriteLine("Min " + minNumber);
446                                            Console.WriteLine("Sum " + sum);
447                                            Console.WriteLine("Product " + product);
448                                            Console.WriteLine("Mean " + mean);
449
450                                            Console.ReadKey();
451                                        }
452
453                                    }
454                                }
455
456                            </pre>
457                        </div>
458                    </div>
459
460                    <!--End of 5 series function -->
461                </div>
462                <div class="modal-footer no-margin">
463                </div>
464            </div>
465        </div>
466    </div>
467    <!-- End of C# modal for 5 Series -->
468    <!-- C# modal for Factorial -->
469    <div class="modal fade" id="cFactorial" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
470        <div class="modal-dialog modal-lg">
471            <div class="modal-content">
472                <div class="modal-header">
473                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
474                    <h1 class="modal-title" id="myModalLabel"><font color="black">Factorial C#</font></h1>
475                </div>
476
477
478                <!--Factorial C# code-->
479
480
481                <div class="modal-body col-sm-12">
482                    <!--My functions-->
483                    <h4 style="color:black">
484                        Write a program that calculates the factorial of a number. The factorial of a non-negative integer <em>n</em>
485                        is the product of all positive integers less than or equal to <em>n</em>. (i.e. 5! = 5 x 4 x 3 x 2 x 1 = 120)
486                    </h4>
487                    <div class="row">
488                        <!--Rows before Column-->
489                        <div class="col-md-12">
490                            <pre class="brush: csharp">
491                                using System;
492                                using System.Collections.Generic;
493                                using System.Linq;
494                                using System.Text;
495                                using System.Threading.Tasks;
496
497                                namespace Factorial_cSharp
498                                {
499                                    class Program
500                                    {
501                                        static void Main(string[] args)
502                                        {
503                                            int factorialNumber;
504                                            int factorialResult = 1;
505                                            string facNumInput;
506
507                                            Console.WriteLine("Enter your factorial number");
508                                            facNumInput = Console.ReadLine();
509                                            factorialNumber = int.Parse(facNumInput);
510
511                                            for (int i = factorialNumber; i > 0; i--)
512                                            {
513                                                factorialResult *= i;
514                                            }
515
516                                            Console.WriteLine("Factorial Number is " + factorialResult);
517
518                                            Console.ReadKey();
519                                        }
520
521                                    }
522                                }
523
524                                                            </pre>
525                        </div>
526                    </div>
527
528                    <!--End of Factorial function -->
529                </div>
530                <div class="modal-footer no-margin">
531                </div>
532            </div>
533        </div>
534    </div>
535    <!-- End of C# modal for Factorial -->
536    <!--C# modal for FizzBuzz-->
537    <div class="modal fade" id="cFizzBuzz" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
538        <div class="modal-dialog modal-lg">
539            <div class="modal-content">
540                <div class="modal-header">
541                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
542                    <h1 class="modal-title" id="myModalLabel"><font color="black">Fizz and Buzz C#</font></h1>
543                </div>
544
545
546                <!--FizzBuzz C# code-->
547
548
549                <div class="modal-body col-sm-12">
550                    <!--My functions-->
551                    <h4 style="color:black">
552                        Write a program that accepts two numbers between 1 and 100 from the user. The program then iterates
553                        through all numbers from 1 to 100, printing numbers in ascending order to the screen. For each number
554                        that is a multiple of the first number input by the user, print "Fizz" instead of the number. For each
555                        number that is a multiple of the second number input by the user, print "Buzz" instead of the number.
556                        For numbers that are multiples of both numbers, print "FizzBuzz" instead of the number.
557                    </h4>
558                    <div class="row">
559                        <!--Rows before Column-->
560                        <div class="col-md-12">
561                            <pre class="brush: csharp">
562                                    using System;
563                                    using System.Collections.Generic;
564                                    using System.Linq;
565                                    using System.Text;
566                                    using System.Threading.Tasks;
567
568                                    namespace FizzAndBuzz_cSharp
569                                    {
570                                        class Program
571                                        {
572                                            static void Main(string[] args)
573                                            {
574                                                int fbOne, fbTwo;
575                                                string oneInput, twoInput;
576                                                int[] fbArray = new int [101];
577
578                                                Console.WriteLine("Enter the first number");
579                                                oneInput = Console.ReadLine();
580                                                fbOne = int.Parse(oneInput); 
581
582                                                Console.WriteLine("Enter the second number");
583                                                twoInput = Console.ReadLine();
584                                                fbTwo = int.Parse(twoInput);
585
586                                                for (int i = 0; i < 100; i++)
587                                                {
588                                                    fbArray[i] = i;
589                                                }
590
591                                                Console.WriteLine("Result: ");
592                                                for (int j = 1; j <= 100; j++)
593                                                {
594                                                    if (fbArray[j] % fbOne == 0 && fbArray[j] % fbTwo == 0)
595                                                        Console.WriteLine("Fizz Buzz");
596                                                    else if (fbArray[j] % fbOne == 0)
597                                                        Console.WriteLine("Fizz");
598                                                    else if (fbArray[j] % fbTwo == 0)
599                                                        Console.WriteLine("Buzz");
600                                                    else
601                                                        Console.WriteLine(j);
602                                                }
603                                                Console.ReadKey();
604                                            }
605                                        }
606                                    }
607                            </pre>
608                        </div>
609                    </div>
610
611                    <!--End of FizzBuzz function -->
612                </div>
613                <div class="modal-footer no-margin">
614                </div>
615            </div>
616        </div>
617    </div>
618    <!-- End of C# modal for FizzBuzz -->
619    <!-- C# modal for Palindrome -->
620    <div class="modal fade" id="cPalindrome" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
621        <div class="modal-dialog modal-lg">
622            <div class="modal-content">
623                <div class="modal-header">
624                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
625                    <h1 class="modal-title" id="myModalLabel"><font color="black">Palindrome C#</font></h1>
626                </div>
627
628
629                <!--Palindrome C# code-->
630
631
632                <div class="modal-body col-sm-12">
633                    <!--My functions-->
634                    <h4 style="color:black">
635                        Write a program that determines whether a word is a Palindrome (the same backward as
636                        it is forward - "radar" for example). Display the result to the user.
637                    </h4>
638                    <div class="row">
639                        <!--Rows before Column-->
640                        <div class="col-md-12">
641                            <pre class="brush: csharp">
642                            using System;
643                            using System.Collections.Generic;
644                            using System.Linq;
645                            using System.Text;
646                            using System.Threading.Tasks;
647
648                            namespace Palindrome_cSharp
649                            {
650                                class Program
651                                {
652                                    static void Main(string[] args)
653                                    {
654                                        Console.WriteLine("Enter your Palindrome Word");
655                                        string inputText = Console.ReadLine();
656                                        int textLength = inputText.Length;
657
658                                        //arrText is an array that stores each individual characters in each individual slot
659                                        char[] arrText = inputText.ToCharArray();
660                                        //bool isPalindrome = true;
661
662                                        // RADAR
663                                        for (int i = 0; i < textLength; i++)
664                                        {
665                                            if (arrText[i] != arrText[textLength - i - 1])
666                                            {
667                                                Console.WriteLine("Not Palindrome");
668                                                i = textLength;
669                                            }
670                                            if(i == textLength-1 && arrText[i] == arrText[textLength - i - 1])
671                                            {
672                                                Console.WriteLine("Palindrome");
673                                            }
674                                        }
675                                        Console.ReadKey();
676                                    }
677                                }
678                            }
679                            </pre>
680                        </div>
681                    </div>
682
683                    <!--End of Palindrome function -->
684                </div>
685                <div class="modal-footer no-margin">
686                </div>
687            </div>
688        </div>
689    </div>
690</body>