Skip to main content

Hands-On Exercise 2

Your second hands-on exercise is a modification of the ObjectScript.DataEntry1 class:

  • Make a new class method, called Prompt(), to contain the three prompts you already have. It should return 1 (true) if the user answers the Name prompt, and 0 (false) otherwise.

  • Make a new class method, called Display(), to contain the display code, and add some extra line feeds and/or text to improve the look of the displayed data.

  • Use public variables so that these two methods can share variables.

  • Change the Main() class method to use a loop that calls Prompt() and Display(). The loop should quit when Prompt() returns false.

  • Save, compile, and test.

For instructions, click below.

Step by Step Solution

FeedbackOpens in a new tab