BACK

Lab 3 Part B - COIN 70a

The function writeInfo should appear here. If it doesn't: oh-oh!

PROBLEM

The instructions are to:
Write a function that will write user-supplied information to the page;
Write a function that will get the information from the user;
Call the first function using as parameters the variables created within the second function.
PROBLEM! - variables within the second function CANNOT be used within the first function!
Solution: - declare the variables globally, before both functions, and intialize them
inside the second function. Include the call for the first function INSIDE the second function.
Call the second function in the body of the HTML page.

Steps to Solving the Problem - Setting up Pseudo-code for Scripts

How I would have approached this problem using Lab 3 Part A instructions:

Part 1 - Solve the Problem using Human Logic

Find out (get) the user's first name and
Find out (get) the user's last name.
Find out (get) the user's favorite color.
Find out (get) the user's favorite food.
Write the user's first name.
Write the user's last name.
Write the user's favorite color.
Write the user's favorite food.

Part 2 - Set up Pseudo-code based on Human Logic

Define variables:
	firstName;
	lastName;
	favoriteColor;
	favoriteFood;
Get user's first name.
Get user's last name.
Get user's favorite color.
Get user's favorite food.
Write to page:
	firstName;
	lastName;
	favoriteColor;
	favoriteFood;