Category: Javascript

  • “Exploring Data Structures and Algorithms: A Comprehensive Assignment”

    Instructions: complete the whole assignment and send the files DONT COPY THE CODE AND SEND IT i need to be able to run the code and see that it works completely

  • JSFiddle Exercises: Temperature Converter, Cylinder Volume Calculator, and URL Parser

    Make a program to convert celsius tempatures to fahrenheit and vice versa, so we can complain about the weather with our friends overseas.
    Reminder: To convert celsius to fahrenheit, multiply by 9, then divide by 5, then add 32. To convert fahrenheit to celsius, deduct 32, then multiply by 5, then divide by 9.
    Unicode Characters: To print the degrees symbol in JavaScript, we need to use the write u00B0 to represent the unicode character for the degress symbol. Requirements
    Store a celsius temperature into a variable.
    Convert it to fahrenheit and output “NN°C is NN°F” in an HTML field (don’t use alert)
    Now store a fahrenheit temperature into a variable.
    Convert it to celsius and output “NN°F is NN°C.” in an HTML field (don’t use alert)
    JavaScript has a built-in tool that can generate a random number between 0 and 1. This tool is called a method. We’ll talk about methods more later in the class. For now, know if you type Math.random(), you’ll get a random number between 0 and 1.
    Using this tool, update your fahrenheit to celsius tempature conversion program to do the following:
    Instead of inputing a value for the Fahrenheit tempature, use Math.random() to generate a random tempature between 0 and 100
    Have to program output: “It is NN°F today. That’s NN°C.” in an HTML field (don’t use alert)
    NOTE: Submit your solution using JSFiddle (as demonstrated in the lecture)!Complete the following three exercises, making sure to adhere to all of the requirements.
    Exercise 1
    Write a JavaScript program to get the volume of a Cylinder with four decimal places using object classes. Volume of a cylinder : V = πr2h where r is the radius and h is the height of the cylinder.
    Your solution must include an HTML and a JavaScript file, with a button to create the cylinder, inputs for the cylinder’s radius and height and an output to show the cyclinder’s volume.
    Your solution must also use an object for the cylinder, a constructor for passing the radius and height, and a getter for returning the volume.
    Exercise 2
    Write a JavaScript program to display the reading status (i.e. display book name, author name and reading status) of the following books.
    var
    library
    =
    [
    { author: ‘Bill Gates’ , title: ‘The Road Ahead’, readingStatus: true },
    { author: ‘Steve Jobs’ , title: ‘Walter Isaacson’ , readingStatus: true },
    { title: ‘Mockingjay: The Final Book of The Hunger Games’ , author: ‘Suzanne Collins’ , readingStatus: false }];
    Exercise 3
    Write a JavaScript function to parse an URL. Your solution must use
    var a = document.createElement(‘a’);
    to create an anchor object.
    Your solution should have a button to start the parsing, an input for the user to enter a URL, and four outputs for the following properties:
    protocol
    hostname port
    query
    NOTE: Submit your three solutions using JSFiddle (as demonstrated in the lecture)!

  • “Calculating Capacity of a Service Reservoir Based on Pumping Rates”

    Determine the capacity of the service reservoir when the following rates of draw off are given.
    Pumping is done from 6 to 22 hours.
    Hours Draw off [%]
    06 – 10 200
    10 – 12 100
    12 – 16 50
    16 – 10 150
    20 – 22 100
    22 – 06 50

  • “Interactive Shopping Cart and Checkout Page Modification”

    Modify the code of shopping cart in video page so that when click on cart icon in header must show on right side the shopping cart and the whole page shift left , and modify the add to cart button , when add item it must show in shopping cart and on icon (like 2 , 3 ) and modify the checkout button with fake payment page