Learning Plan 2 : Variables and Data Types
Part 1
- Open this file in your browser and Microsoft Visual Studio
- Add your name, section, and email
- After the line:
PART 1: YOUR CODE STARTS AFTER THIS LINE:
- Create a variable for a name.
- Prompt the user for a name and assign the resulting value to the variable you created.
- Output the variable to the page.
Your Part 1 Output:
Part 2
- After the line:
PART 2: YOUR CODE STARTS AFTER THIS LINE:
- Create a variable for a first name.
- Create a variable for a last name.
- Prompt the user for a first name and assign the resulting value to the first name variable.
- Prompt the user for a last name and assign the resulting value to the last name variable.
- Output the first name variable to the page with a
document.write() statement.
- Output a single space with a
document.write().
- Output the last name variable to the page with a
document.write() statement.
- Sample Output:
Joe Smith
Your Part 2 Output:
- After the line:
PART 3: YOUR CODE STARTS AFTER THIS LINE:
- Create two variables
- Prompt the user for a first name and assign the value to the firstName variable.
- Prompt the user for a last name and assign the value to the lastName variable.
- Output the user's first name on one line.
- Output the user's last name on the next line.
- Sample Output:
Joe
Smith
Your Part 3 Output:
- After the line:
PART 4: YOUR CODE STARTS AFTER THIS LINE:
- Create variables for the following:
- a street address
- a city
- a state
- a zip code
- Prompt the user for each value.
- Output the street address on one line.
- On the next line, output the city followed by a comma and a space, the state following by a space, then the zip code.
Your Part 4 Output: