• +91 9898989898
  • info@assignmentonlinehelp.com
Blog

Are You A Prospective Programmer Interested In Learning JavaScript Programming?

Would you like assistance in JavaScript college projects? Simply Upload your JavaScript assignment details to Assignment Online Help for professional and accurate JavaScript college homework solutions.
For those new to JavaScript, it can be defined as a high level and interpreted programming language which makes websites and webpages to attain interactivity. For instance, have you looked on a website and thought that it lacks some aspects? Then you would wish the website to be more engaging or creative? If this is the case, then JavaScript is what you need. It enhances the performance of the application, webpage among other functions. Also, it creates a user-friendly experience for online users.
Assignment Online Help has a pool of competent JavaScript homework helpers who will tackle any JavaScript assignment problem or JavaScript college problem with ease. These experts can also tutor prospective programmers to make their websites to be more interactive by adding motion to it.
While learning JavaScript it is important to note that JavaScript is a scripting language and not Java programming language, the language was first referred to as Mochas and later named as Mocha before finally being named as JavaScript.

What Is Good About JavaScript Homework Assistors At Assignment Online Help
1. The website operates on a 24/7-hour basis, this makes it possible for students to upload JavaScript programming assignments at any time of day or night from all over the globe
2. Affordable rate and accurate complete JavaScript assignment solutions
3. Instant live chat for Java programming college problems

Upload any technical issues affecting your ability to complete JavaScript programming college coursework at Assignment Online Help for the best JavaScript homework help.

At Assignment Online Help, we believe in delivering the best to our scholars. Our Online JavaScript Help is well designed. It's always devoted to giving you academic excellence with the utmost professionalism. Through this, countless JavaScript learners at masters and Ph.D. levels have benefitted dramatically with our support. We have built a strong stature in this industry. That's why our praises on JavaScript Homework Help can't cease. Why are our facilities prominent than other service providers in this domain? Our services are equipped with unique features. Their uniqueness has made us global leaders. Do you want to enjoy them? Then follow these three simple steps!  
 
1. Visit our homepage and tell us what you need. Using any communication channel start it by JavaScript Homework. You will be provided with an online order placement form. Fill it with your personal and educational required details. If you need specialized assistance, you can specify it here.  
2. Initiate the payment for the JavaScript assignment. The moment you click the upload button, you will receive an appropriate quote from our automatic calculators. You can use Stripe, internationally accepted credit, or debit card to pay for your requested JavaScript Project Help. 
3. Receive your meticulously crafted JavaScript solution document on time. Immediately you accept our working terms and conditions we will assign your order to one of our Ph.D. stalwarts. Rest assured to receive your JavaScript paper on time!
 
This is your chance buddy to pen down a new academic testimony. Try us now! 
 
Our JavaScript Experts have prepared sample assignment solution to demonstrate the quality of our work. All the solutions have been prepared by following a simplistic approach and include step by step explanations. These solutions reflect the in-depth expertise and experience of our online JavaScript assignment experts.
 
Introduction -Analysis
Our interactive dictionary uses Java’s Enum class as the database.
The sample outputs show that we are loading data into the dictionary from the Enum class. When the program is finished loading, it prompts the user to make a search. The search input is based on 3 keywords. The first keyword should be the key word to search for(ex: CSC210). The 2nd Keyword and 3rd key word can be interchangeable. They must be either the part of speech key word or the key word “Distinct”. Distinct is used in order to get one distinct part of speech. This basically means don’t display any copy’s from the database that have the same part of speech from the key word. The problem this program is solving is figuring out what data structures are best used to store information and get information from the dictionary based on key words.
How we store data in Enum objects
The way I stored Enum objects is by having 3 separate strings in each object. The first string is the Keyword, 2nd is the part of speech, and 3rd is the definition. The reason why I did this was so that it would be easy to construct the constructor. Also, this makes the database more dynamic. I can easily add values to the database and it won’t affect how the interface will act.
I first created enum for all the parts of speech:
enum Speech
{
    ADJECTIVE("Placeholder [adjective] : To be updated..."),
    ADVERB("Placeholder [adverb] : To be updated..."),
    CONJUNCTION("Placeholder [conjunction] : To be updated..."),
    INTERJUNCTION("Placeholder [interjunction] : To be updated..."),
    NOUN("Placeholder [noun] : To be updated..."),
    PREPOSITION("Placeholder [preposition] : To be updated..."),
    PRONOUN("Placeholder [pronoun] : To be updated..."),
    VERB("Placeholder [verb] : To be updated...");
 
    private String value;
 
    Speech(String s) { this.value = s; }
 
    public String getValue() { return value; }
};
Then created enum for  definitions used in this program:
enum Data
{
    LOADING("! Loading data..."),
    LOADING_COMPLETED("! Loading completed..."),
    PRINT("-----DICTIONARY 340 JAVA----"),
    OOPS("arguments must be a part of a speech or \"distinct\""),
    SEARCH("Search: ");
 
    private String value;
 
    Data(String s) { this.value = s; }
 
    public String getValue() { return value; }
};
Data Structures used to create the dictionary
The data structures I used were Array List and Hash Map. I used Array List because the array of Enum objects needs to be dynamic. I need to use an array but normal arrays in Java must have a fixed size. Array List data structure allows for dynamic sized arrays and implements the List interface. I used hash maps because of the basic implementation of Map interface. It stores the data by taking in a Key and Value. The key can be the users input while the Values are being passed by the ArrayList. Dictionary is the name of my Enum class.
I generated all the values required in the dictionary by using the values from enum:
        List noFilter = new ArrayList<>();
        noFilter.add(Speech.ADJECTIVE.value);
        noFilter.add(Speech.ADJECTIVE.value);
        noFilter.add(Speech.ADVERB.value);
        noFilter.add(Speech.CONJUNCTION.value);
        noFilter.add(Speech.INTERJUNCTION.value);
        noFilter.add(Speech.NOUN.value);
        noFilter.add(Speech.NOUN.value);
        noFilter.add(Speech.NOUN.value);
        noFilter.add(Speech.PREPOSITION.value);
        noFilter.add(Speech.PRONOUN.value);
        noFilter.add(Speech.VERB.value);
 

 
Step-by-step explanation
 
import java.util.*;
 
public class Search {
 
//create enum for all the parts of speech
enum Speech
{
    ADJECTIVE("Placeholder [adjective] : To be updated..."),
    ADVERB("Placeholder [adverb] : To be updated..."),
    CONJUNCTION("Placeholder [conjunction] : To be updated..."),
    INTERJUNCTION("Placeholder [interjunction] : To be updated..."),
    NOUN("Placeholder [noun] : To be updated..."),
    PREPOSITION("Placeholder [preposition] : To be updated..."),
    PRONOUN("Placeholder [pronoun] : To be updated..."),
    VERB("Placeholder [verb] : To be updated...");
 
    private String value;
 
    Speech(String s) { this.value = s; }
 
    public String getValue() { return value; }
};
 
//creating enum for  definitions used in this program
enum Data
{
    LOADING("! Loading data..."),
    LOADING_COMPLETED("! Loading completed..."),
    PRINT("-----DICTIONARY 340 JAVA----"),
    OOPS("arguments must be a part of a speech or \"distinct\""),
    SEARCH("Search: ");
 
    private String value;
 
    Data(String s) { this.value = s; }
 
    public String getValue() { return value; }
};
 
//creating enum for all the definitions of CSC210 used in this program
enum CSC210
{
    ADJECTIVE1("CSC210 [adjective] : Comfortable with Objects and Classes"),
    ADJECTIVE2("CSC210 [adjective] : Ready for CSC 220"),
    NOUN("CSC210 [noun]Intro to Java "),
    VERB("CSC210 [verb] : To learn Java");
 
    private String value;
 
    CSC210(String s) { this.value = s; }
 
    public String getValue() { return value; }
};
 
//creating enum for all the definitions of CSC340 used in this program
enum CSC340{
    ADJECTIVE("CSC340 [adjective] : = C++ version of CSC210 + CSC220 + more."),
    NOUN1("CSC340 [noun] : A CS upper division course."),
    NOUN2("CSC340 [noun] : Many hours outside of class."),
    NOUN3("CSC340 [noun] : Programming Methodology.");
 
    private String value;
 
    CSC340(String s) { this.value = s; }
 
    public String getValue() { return value; }
}
 
//creating enum for all the definitions of Verb used in this program
enum Verb{
    Noun("Verb [noun] : Verb is a word or group of words that expresses an action (such as eat), an event\n" +
            "(such as happen) or a state (such as exist).");
    private String value;
 
    Verb(String s) { this.value = s; }
 
    public String getValue() { return value; }
}
 
//creating enum for all the definitions of Book used in this program
enum Book {
    Noun1("Book [noun] : A set of pages."),
    Noun2("Book [noun] : A written work published in printed or electronic form."),
    Verb1("Book [verb] : To arrange for someone to have a seat on a plane."),
    Verb2("Book [verb] : To arrange something on a particular date.");
    private String value;
 
    Book(String s) { this.value = s; }
 
    public String getValue() { return value; }
}
 
//creating enum for all the definitions of Bookable used in this program
enum Bookable {
    ADJECTIVE("Bookable [adjective] : Can be ordered in advance.");
 
    private String value;
 
    Bookable(String s) { this.value = s; }
 
    public String getValue() { return value; }
}
 
//creating enum for all the definitions of Conjunction used in this program
enum Conjunction {
    NOUN("Conjunction [noun] : Conjunction is a word that joins words, phrases or sentences, for example 'and', 'but', 'or'.");
 
    private String value;
 
    Conjunction(String s) { this.value = s; }
 
    public String getValue() { return value; }
}
 
//creating enum for all the definitions of Interjection used in this program
enum Interjection {
    NOUN("Interjection [noun] : Interjection is a short sound, word or phrase spoken suddenly to express an emotion. Oh!, Look out! and Ow! are interjections.");
 
    private String value;
 
    Interjection(String s) { this.value = s; }
 
    public String getValue() { return value; }
}
 
//creating enum for all the definitions of Adjective used in this program
enum Adjective {
    NOUN("Adjective [noun] : Adjective is a word that describes a person or thing, for example big, red and clever in a big house, red wine and a clever idea.");
 
    private String value;
 
    Adjective(String s) { this.value = s; }
 
    public String getValue() { return value; }
}
 
//creating enum for all the definitions of Exit used in this program
enum Exit {
    NOTFOUND(""),
    EXIT("-----THANK YOU-----");
 
    private String value;
 
    Exit(String s) { this.value = s; }
 
    public String getValue() { return value; }
}
 
public static void main(String[] args) {
 
        System.out.println(Data.LOADING.getValue());
 
        //Generating all the values required in the dictionary by using the values from enum
        List noFilter = new ArrayList<>();
        noFilter.add(Speech.ADJECTIVE.value);
        noFilter.add(Speech.ADJECTIVE.value);
        noFilter.add(Speech.ADVERB.value);
        noFilter.add(Speech.CONJUNCTION.value);
        noFilter.add(Speech.INTERJUNCTION.value);
        noFilter.add(Speech.NOUN.value);
        noFilter.add(Speech.NOUN.value);
        noFilter.add(Speech.NOUN.value);
        noFilter.add(Speech.PREPOSITION.value);
        noFilter.add(Speech.PRONOUN.value);
        noFilter.add(Speech.VERB.value);
 
        List distinct = new ArrayList<>();
        Arrays.stream(Speech.values()).forEach(speech -> distinct.add(speech.value));
 
        List noun = new ArrayList<>();
        noun.add(Speech.NOUN.value);
        noun.add(Speech.NOUN.value);
        noun.add(Speech.NOUN.value);
 
        List adjective = new ArrayList<>();
        adjective.add(Speech.ADJECTIVE.value);
        adjective.add(Speech.ADJECTIVE.value);
 
        List csc210 = new ArrayList<>();
        Arrays.stream(CSC210.values()).forEach(speech -> csc210.add(speech.value));
 
        List csc210noun = new ArrayList<>();
        csc210noun.add(CSC210.NOUN.getValue());
 
        List csc210adjective = new ArrayList<>();
        csc210adjective.add(CSC210.ADJECTIVE1.getValue());
        csc210adjective.add(CSC210.ADJECTIVE2.getValue());
 
        List csc210verb = new ArrayList<>();
        csc210verb.add(CSC210.VERB.getValue());
 
        List cSC340 = new ArrayList<>();
        Arrays.stream(CSC340.values()).forEach(speech -> cSC340.add(speech.value));
 
        List cSC340noun = new ArrayList<>();
        cSC340noun.add(CSC340.NOUN1.getValue());
        cSC340noun.add(CSC340.NOUN2.getValue());
        cSC340noun.add(CSC340.NOUN3.getValue());
 
        List cSC340adjective = new ArrayList<>();
        cSC340adjective.add(CSC340.ADJECTIVE.getValue());
 
 
        List verb = new ArrayList<>();
        Arrays.stream(Verb.values()).forEach(value -> verb.add(value.value));
 
        List book = new ArrayList<>();
        Arrays.stream(Book.values()).forEach(value -> book.add(value.value));
 
        List booknoun = new ArrayList<>();
        booknoun.add(Book.Noun1.getValue());
        booknoun.add(Book.Noun2.getValue());
 
        List bookverb = new ArrayList<>();
        bookverb.add(Book.Verb1.getValue());
        bookverb.add(Book.Verb2.getValue());
 
        List bookable = new ArrayList<>();
        bookable.add(Bookable.ADJECTIVE.getValue());
 
        List conjunction = new ArrayList<>();
        conjunction.add(Conjunction.NOUN.getValue());
 
        List interjectionnoun = new ArrayList<>();
        interjectionnoun.add(Interjection.NOUN.getValue());
 
        List adjectivenoun = new ArrayList<>();
        adjectivenoun.add(Adjective.NOUN.getValue());
 
        List exit = new ArrayList<>();
        exit.add(Exit.EXIT.getValue());
 
        List notFound = new ArrayList<>();
        notFound.add(Exit.NOTFOUND.getValue());
 
        //Generating the dictionary and mapping the key-value pairs
        Map dictionary = new HashMap<>();
        dictionary.put("placeholder",noFilter);
        dictionary.put("distinct", distinct);
        dictionary.put("noun", noun);
        dictionary.put("adjective", adjective);
        dictionary.put("oops", Arrays.asList(Data.OOPS.getValue()));
        dictionary.put("csc210", csc210);
        dictionary.put("csc210noun", csc210noun);
        dictionary.put("csc210adjective", csc210adjective);
        dictionary.put("csc210verb", csc210verb);
        dictionary.put("csc340", cSC340);
        dictionary.put("csc340noun", cSC340noun);
        dictionary.put("csc340adjective", cSC340adjective);
        dictionary.put("verb", verb);
        dictionary.put("verbnoun", verb);
        dictionary.put("book", book);
        dictionary.put("booknoun", booknoun);
        dictionary.put("bookverb", bookverb);
        dictionary.put("bookable", bookable);
        dictionary.put("conjunction", conjunction);
        dictionary.put("interjectionnoun", interjectionnoun);
        dictionary.put("adjectivenoun", adjectivenoun);
        dictionary.put("exit", exit);
        dictionary.put("notFound", notFound);
 
        System.out.println(Data.LOADING_COMPLETED.getValue());
        System.out.println();
        System.out.println(Data.PRINT.getValue());
        System.out.println();
 
        //Taking the input search parameter from user and displaying the required data from the dictionary using the search key
        while (true) {
        Scanner reader = new Scanner(System.in);
        String userInput = null;
        String search = null;
        System.out.print(Data.SEARCH.getValue());
        userInput = reader.nextLine();
 
        //checking the number of arguments given by the user and handling the program accordingly so that it will not break
        String[] arr=userInput.split(" ");
        if (arr.length==1) {
            search = arr[0];
            getSearchResults(search, null, dictionary);
        }
        else if (arr.length==2) {
            if (arr[0].equalsIgnoreCase("placeholder"))
                search = arr[1];
            else search = arr[0] + arr[1];
            getSearchResults(search,null,dictionary);
        }
        else if (arr.length==3) {
            if (arr[0].equalsIgnoreCase("placeholder"))
                search = arr[1];
            else search = arr[0] + arr[1];
            getSearchResults(search, arr[2], dictionary);
        }
        }
}
 
public static void getSearchResults(String name, String arg2, Map dictionary){
        System.out.println("   |" );
        List searchResult=null;
        if (name.equalsIgnoreCase("!Q")){
            searchResult = (List) dictionary.get("exit");
        }
        else if (dictionary.containsKey(name)) {
         searchResult = (List) dictionary.get(name);
        }
        else searchResult = (List) dictionary.get("notFound");
 
        if (arg2!=null && arg2.equalsIgnoreCase("distinct")){
        new HashSet<>(searchResult).stream().forEach(s -> {
            System.out.print("     ");
            System.out.println(s);
        });
        }
        else {
        searchResult.stream().forEach(s -> {
        System.out.print("     ");
        System.out.println(s);
        });
        }
 
        System.out.println("   |" );
        if (name.equalsIgnoreCase("!Q")){
          System.exit(0);
        }
}
}
 

Related Posts