Write the code for adding a task

Assignment Help Programming Languages
Reference no: EM13843680

In this exercise, you'll develop an application that uses an array to manage a "To Do" list. To keep this simple, assume that you do the tasks on a FIFO basis. That is, the first task added to the list is the first one that you do, so the next task is always the first one in the list.

592_Untitled.png

• Begin with the filestodo_list.js and todo_list.html. Then, run the application to see the user interface shown above, although that interface won't do anything until you develop the JavaScript for it.

• In the JavaScript include a global variable declaration for an empty array named taskList. Then, write the code for adding a task to this array when the user enters a task in the first text box and clicks the Add Task button. This code should also blank out the text box. At this point, don't worry about displaying the tasks in the text area for the task list. Instead, use alert statements to print the array to make sure this works when you add one or more items.

• Add the JavaScript code for the click event handler (function) of the Show Next Task button. This handler should display the first task in the array in the Next task text box and remove its item from the array. To remove the first item in an array, you can use the shift method.

• In the event handler (function) for the Show Next Task button, test to make sure the array has items in it. If it doesn't, use the alert method to display "No tasks remaining" and clear the task from the Next task text box.

• Add a JavaScript function that displays the elements in the array in the Task list text area. Then, call this function from both of the click event handlers (functions) so the updated task list is displayed each time a task is added to the list or removed from it.

• Give this application a final test to make sure it works correctly.

Reference no: EM13843680

Questions Cloud

Most widely associated with workers'' compensation : Summarize briefly the problems most widely associated with workers' compensation. What does the insurance industry use Experience Modification Rate (EMR) to determine?
Ethical issue: reclassification of receivables : Reclassification of Receivables
What is the delphi method in operations management : What is the delphi method in operations management? Can you please explain how the delphi method works?
Which of the following is a contra receivable account? : Which of the following is a contra receivable account?
Write the code for adding a task : write the code for adding a task to this array when the user enters a task in the first text box and clicks the Add Task button. This code should also blank out the text box. At this point, don't worry about displaying the tasks in the text area f..
Train apprentice mechanics : If the profit of Vroom Ltd exceeds $3 million, Freda receives the maximum bonus of $30 000. Vroom Ltd currently receives a grant from the government of $100 000 per year to employ and train apprentice mechanics.
What is the periodic interest rate : You are purchasing a house that cost $500,000.You plan on making a down payment of $100,000 and borrowing the difference.The terms of your mortgage will be $ 400,000 in principal, 30-year term, and a fixed APR 3.875 %. The loan payments are monthly a..
An expansion program : A regional fast-food restaurant is considering an expansion program. The major factor influencing the success of such a program is the future level of interest rates. It is estimated that there is a 40 percent chance that interest rates will increase..
Summarize the given ppt and analysis with own thoughts : Summarize the atteched PPT and analysis with own thoughts- Rob Elliott, vice president of government affairs for MGM Mirage

Reviews

Write a Review

Programming Languages Questions & Answers

  This is a programming assignment and it needs you to write

this is a programming assignment and it requires you to write the pseudocode for a program that solves the following

  Pseudocode of program that will prompt user for number

Write pseudocode and flowchart for a program which will prompt user for a number, prompt the user for an operator (+,-,*,/), prompt the user for another number.

  Create a form using the form tool

Courtyard Medical Plaza wants to add a form and a report to its database. To ensure consistency, the starting file is provided for you. Create a blank form and modify the form in Layout view.

  Biggest challenges in planning and designing

In your opinion, what are the three biggest challenges in planning and designing a solution for a programming problem? What can you do to overcome these challenges

  Design considerations to comply with ada

Browsing devices that assist people with disabilities, such as an aural browser, are especially dependent on the best use of CSS styles. What design considerations should you be aware to comply with ADA?

  Design an appropriate set of classes to solve the problem

The purpose of this project is for you to demonstrate your understanding of object oriented software development in practice.

  Write a program to compute the diameter of a steel rod

Write a program to compute the diameter in centimeters of a steel rod, an aluminum rod, and copper rod, which can withstand a particular compression load

  Write pseudocode to show positive and negative numbers

Write down pseudocode which will accept 25 integers and show the number of positive and negative numbers. Mention whether pseudocode utilizes a finite or indefinite loop.

  Write a program to enter the number of apartment units

Write a program that prompts the user to enter the number of apartment units, the rent to occupy all the units, the increase in rent that result in a vacant unit.

  Calculate display the area of a rectangle (length * width)

Use the input.txt file. Have it read in the number of records to work on. Then for each record read in a character. If it is a C then read in a value and calculate and display the area of a circle (pi*r 2 ), a R then read in two values and calculate ..

  Write statement that calls add to compute sum of sales

Add is a method that accepts two int arguments and returns their sum. Write a statement that calls add to compute the sum of euroSales and asiaSales and that stores this value in eurasiaSales .

  Program to input the assignment number

The program must prompt teacher to input the assignment number. Score for student for that assignment will be displayed.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd