JavaScript

Monday April 7, 2025
updated: April 10, 2002

 
Home
Getting Started
Lesson 1
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Resources
Credits

 

 


Assignment 1

Create a JavaScript that will do the following:

1. Using a prompt box ask the user for the following information:

  • What is your name?
  • How old are you?

2. Write a script to determine what year the user was born.

3. Using an alert box display the following: "Hello, name (name input by user). You were born in year (value calculated in 2)

4. Save As: A2YourName.

HINT: don't forget to declare the variables

HINT: only variables which are integers can have mathematical operations performed on them. You will need to use ParseInt().


© 2002 Tracy Johnson