Missing page.
Sorry. The page you requested does not exist on the Department of Computer Science website
Return to the Computer Science Home Page
[an error occurred while processing this directive]
File: body-title.shtml
Creator: George Ferguson
Created: Tue Dec 6 14:34:49 2011
Time-stamp:
SSI variables for this template:
section_name First line of title on page (if any)
title Title shown on page
[an error occurred while processing this directive]
CSC170: Introduction to Programming and the Web
Fall 2012
[an error occurred while processing this directive]
Assignment 4: Expressions and Conditions: Part 1
- [2 pts]
Create a page that asks a user first for their name, then for
their favorite color, and then for their phone number and
displays the results as a table in the page.
- [2 pts]
Create a page that asks the user for two numbers (that is, asks
twice for one number each time) and then displays the numbers and
their sum, difference, product, quotient, and remainder as a table
in the page.
- [2 pts]
Create a page that asks the user for a number and reports whether
or not the number is even. Hint: Think what it means to be even
and check out the remainder operator (
%
).
Things to think about
-
Understand the difference between strings and numbers (even though
Javascript converts many things to strings when necessary).
-
Understand that even though Javascript is
a weakly (or
loosely) typed language, nonetheless values are typed.
-
Check out the
typeof
operator which can be helpful in debugging type problems.
On to Part 2 when it is available...
[an error occurred while processing this directive]
File: doc-finish.shtml
Creator: George Ferguson
Created: Tue Dec 6 13:46:48 2011
Time-stamp:
[an error occurred while processing this directive]
File: body-footer.shtml
Creator: George Ferguson
Created: Tue Dec 6 14:43:56 2011
Time-stamp:
Content at bottom of page, if any.
Last update: Wednesday, 26-Sep-2012 10:24:22 EDT
[an error occurred while processing this directive]
File: body-finish.shtml
Creator: George Ferguson
Created: Tue Dec 6 13:47:36 2011
Time-stamp:
[an error occurred while processing this directive]