Wednesday, November 25, 2015
I have not posted any blog entries in the last few days because I have been working extremely hard in Grade 12 Computer Science. Over the past week we were given two new coding assignments: Local Storage and Quicksort. Both of these assessments focus on the coding language of JavaScript to work correctly and efficiently. By creating demonstrations of both these functions, I have gained the practice and skills to implement similar code into my primary project in this class (the Send Over Service Website).
The first assignment is called Local Storage. By creating the relating JavaScript, I can save and store information that the user inputs into the onscreen fields and use this information in different places on the website in the future by recalling the function.
For example, in my application of Local Storage, I have created input boxes to register for the Send Over Service site. The boxes include sections for the new clients to supply their name and email address. Thusly, they create an account with their new username and password (that they choose). The information they input is saved to local storage after they click “Register”. Furthermore, I have taken my code one step further, and above the requirements of the assignment, by building a subsequent Login Page. This section of the website is to be accessed by returning clients. Here they will be able to enter the information that was saved from the Registration Page. To ensure a user-friendly registration and login process, I have created “alerts” in the form of pop-up windows that will appear on the site. When a new client joins the site, a window will appear that says, “Congratulations! You are now an official member of the Send Over Service Community!” Not only does this alert inform the user that they have been successfully registered to use the site, it also provides some motivation for the client to begin working with my company. After all, Send Over Service is “A Brand, A Community, A Place to Work” (as I said when creating the site’s Mission Statement). The Login Page also has alert to inform the client that they are logged into the server. However, because I know that clients will repeatedly be returning to the site, I have allowed the client to decide if they would like to always view this pop-up window.
The other assessment is comprised of creating a demonstration of Quicksort. I explained the significance of this sorting algorithm in a previous blog post (check it out before continuing so you can gain a better understanding of the concept). My function sorts a randomly generated set of numbers from least to greatest. Therefore, the first step in the process is to create this set of numbers. I begin my JavaScript by implementing the code for a random number generator. This will create 20 numerical whole number values from 1-100 when the code is run. Moreover, to begin sorting, 2 indexes have to be made. Next, a pivot point must be declared so that the function can use it for comparison when deciding whether a number should be classified as less than or greater than. The function is recursive, and therefore, will continue sorting the set of values. However, the way that I have set up my code prevents the possibility of a stack overflow (a concept which I have also explained in a previous blog post).
After ensuring that each part of the JavaScript worked effectively and efficiently, I created an HTML and CSS based website with different pages to display my code and the information I use to explain it.
If you are interested in the actually “Behind the Scenes” of what is happening, feel free to visit that page of my Quicksort website. Furthermore, each part of the code is explained, section-by-section, in my JavaScript code for Quicksort.