Evaluate the function

Assignment Help Programming Languages
Reference no: EM13935520

Can you please see below and review attachment. (adding parameters to functions & using function parameters)

You made some modifications to your program, but you did not change the function to accept a parameter. You can either modify the function in your program to accept a parameter, or you can use the function I demonstrate below in your program by adding it to your source code file.

To demonstrate I'm going to create a function that meets those requirements described below.

I'm going to name the function display_alert, because that is what the function does.

I'm going to name the parameter, message, because that's what the data contains.

The function is defined as follows:

function display_alert(message){
window.alert(message);
}

It looks very similar to the function you defined below, except for the fact that it gets the data to be displayed in the alert message, from the input parameter.
It uses the parameter variable as an argument to pass to the window.alert() function.

Your program should call this function 13 times.

Each time the function is called, the parameter variable will have a different value.

Two examples of calling the above function with an argument:

var mess1 = "Ten";
display_alert("Ten"); // call the function with an string literal argument
display_alert(mess1); // call the function with a variable argument
// A variable must be declared before(above) using it.

In both examples the value passed to the function is the string "Ten".

Notice that the name of the variable used in the argument does not have to be the same as the name of the parameter variable in the function definition.

Attachment:- Assignment2.zip

Reference no: EM13935520

Questions Cloud

Strategic human resource management practices : Engaging and motivating employees is at the centre of Strategic Human Resource Management (SHRM) practices. It is therefore important to identify the organisational practices that can be used to foster the cognitive, emotional and behavioural qual..
Calculate the expected value of projects net present value : Calculate the expected value of the project's net present value (NPV) and determine the probability that the project will have a negative NPV.
Explain code of dna : Briefly describe the debate between the theory of spontaneous generation and the theory of biogenesis. Explain how Louis Pasteur's experiment with the S-neck flasks in the 1800s resolved this debate. Include a detailed description of Pasteur's exp..
How country risk affects npv : How country risk affects NPV. Explain how the capital budgeting analysis in the previous question would need to be adjusted if there were three possible outcomes for the dollar along with the possible outcomes.
Evaluate the function : Can you please see below and review attachment. (adding parameters to functions & using function parameters)
Explain why the jc penney stores in mexico : Explain why the JC Penney stores in Mexico and in other foreign markets are subject to financial risk (a subset of country risk).
How well integrated are hrm processes : How well integrated are HRM processes with the organisation's strategic business directions? Specify the areas where the linkages do/do not occur, how one link might support or constrain another, and the implications of these relationships.
How is surveillance of the tissues carried out : Contrast active and passive immunity in terms of how each is acquired, how long it lasts, whether memory is triggered, how soon it becomes effective, and what immune cells and substances are involved.
Benefits and purpose for an organizational vision statement : Describe the core values of the organization. Why are these specific values important to the organization? Describe the benefits and purpose for an organizational vision statement. Develop a vision statement for this organization. When developing a ..

Reviews

Write a Review

Programming Languages Questions & Answers

  Create a glossary generator

Prompt the user to enter a word, return its definition and scrabble score (or output "not valid in scrabble")

  Basics of hypertext markup language

The basics of Hypertext Markup Language and World Wide Web.

  Desigh program that enters first and second number

Desigh a program which enters first and a second number. First and second number which will be entered should be computed in halves, quarter, double, and square using JoptionPane input dialog.

  Add comment lines for the different sections.

Add comment lines for the different sections.

  Program to compute pearson correlation coefficient

Write down a program to compute Pearson correlation coefficient by using parallel loop templates from Intel Threading Building Blocks library (TBB).

  You are consulting for an organization that has unix linux

question 1 the small company where you work needs to implement a second server for its accounting systems but does not

  Ways to ensure that website is easy to navigate

A good practice would be to spread the content out among several pages. What are some ways to ensure that your website is easy to navigate?

  Write a program to enter series of numbers

Write a program that ask the user to enter a series of numbers ending with -1. After the -1 is input, program should print how many numbers are even and how many numbers are odd.

  Determine the total resistance of a number of resistors

Prepare a function that will determine the total resistance of a number of resistors that are connected in parallel.

  Write a program that will operate the alarm simulation

Write a program that will operate the Alarm Simulation, using the following inputs and outputs and whatever Timers and Flags are required.

  What will the following program segments display

What will the following program segments display

  What default link state and visited link state

what default link state and visited link state are,on a CSS style sheet. And how to put them on the stlye sheet.

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