If your code isn't working as expected, try opening up Firefox's error console to check for (potentially) helpful error messages. If you get stuck, don't hesitate to ask the instructor or a teaching assistant for help.
Tip: Here are some handy keyboard shortcuts:
Select-All: Command-A (Mac), Control-A (Windows)
Copy: Command-C (Mac), Control-C (Windows)
Paste: Command-V (Mac), Control-V (Windows)
alertfunction is a "Do Something" method (it does something for us), the
promptfunction is a "Return Something" method (it returns a value to us). That value is being stored in a variable, and is then being used in the next call to
Mary, she should see an alert window that contains a message such as
Hello Mary, I am glad to see you!.
Tip: Don't forget that the "+" symbol can be used to combine two or more strings.
madLibfunction to construct a simple Mad Libs story. You should prompt for three words: one noun, one verb, and one adjective. Each word should be stored in an appropriately named variable. Then use an alert box to display a short story constructed using the words the user entered. A sample session might look like the following:
[prompt] Please enter a noun. [user enters] monkey [prompt] Please enter a verb. [user enters] jump [prompt] Please enter an adjective. [user enters] happy [alert] When I was walking to work today I saw a monkey! It was very happy and it made me want to jump. OR [alert] It's your turn to jump over the happy monkey.Be creative! If you wish, you may prompt for additional words and create a more involved story.
If you worked in a team, each member of your group should do this, so each of you has a link to your MadLibs page.
COMP 105 Assignments
- Link to Mini-Lab 1
- Link to Mad Libs Mini-Lab
people.kzoo.eduserver (remember that its host name for uploading is
peopleftp.kzoo.edu). Test that the link to the Mini-Lab works on the server by clicking on it from your home page.