Assignment 2 Program

Simple program to get running and modify slightly



Description

This simple program askes for 2 numbers from the user and computes the difference (subtraction) of those numbers. It then askes for 2 more numbers from the user and computes the product (multiplication) of those numbers.

It illustrates these new concepts:

  1. declaring variables and storing information into them
  2. writing expressions to retrieve stored data and manipulate it algebraically
  3. simple keyboard input (prompt)
  4. simple screen output (alert)
  5. defining a named function in the head part
  6. executing a named function by clicking a button
  7. user input from the keyboard with "prompt"

Input

User will supply 2 numbers, one at a time when prompted. User will then supply 2 more numbers, one at a time when prompted. Integers or reals (decimal numbers) are ok to use.

Output

The program will print to the screen the difference of the first pair of numbers.
The program will print to the screen the product of the second pair of numbers.

Termination

The program will end automatically after doing the product computation (after the second pair).