WDV2221 Intro Javascript

Unit-4 Assignment - Functions with Parameters


Problem 1

a. Create a global variable called schoolName. Assign it an initial value of "Des Moines Area Community College".

b. Create a function called processString( ).

c. Call this function using a button and the onclick event handler. Pass in the schoolName variable as the parameter.

Problem 2

a. Create two global variables. One called name1 and assign it a value of "Mary". The other called name2 and assign it a value of "Smith".

b.  Create a function called printName( ).

c. Call this function during runtime. Pass in the name1 and name2 variables as the parameters.

My Work

Be sure to have your developer tools open so you can monitor the console

Output from problem 2: