Skip to main content
Previous sectionNext section

Hands-On Exercise 1

For your first few hands-on exercises, you are going to develop a simple data entry system. You'll create the ObjectScript.DataEntry1 class, according to the following specification:

  • Create a class method called Main().

  • Create three prompts, for Name, Phone (US style), and Date of Birth.

  • Use the Write command to show the data entered, in this format:

    
    Name:    John Smith
    Phone:   555-1111
    DOB:     1/23/45
    Copy code to clipboard
  • Between the Name and Phone prompts, add a line that determines if the user pressed Enter without entering anything at the Name prompt. If so, end the method.

  • Save and compile your class.

  • Start a Terminal session and Do your new method.

For instructions, click below.

Step by Step Solution