Wj 1102a Module2 Exercise3

  • Uploaded by: Rajani Ramsagar
  • 0
  • 0
  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Wj 1102a Module2 Exercise3 as PDF for free.

More details

  • Words: 158
  • Pages: 1
Exercise 2: Creating a Test Class The objective of this exercise is to create your own test class.

Task 1 – Developing a Test Class to Test Another Class In this task, you create a test class to test a Customer class. The Customer class has seven variables: customerID, name, address, phoneNumber, emailAddress, status, and totalPurchases. The Customer class has a method to display customer information called displayCustomerInfo. Follow these steps to create your test class: 1. Go to the object_structure directory. 2. Create a test class that has a main method. 3. In the main method: a. Create an object reference variable that refers to an instance of the Customer class. b. Set the customer’s customerID to an integer value. c. Set the customer’s status to ‘O’ for old. d. Set the customer’s totalPurchases to 100.00. e. Invoke the displayCustomerInfo method of the Customer class. 4. Compile and run the program using the provided Customer class file.

Related Documents

Module2
June 2020 21
Exercise3 A
November 2019 2

More Documents from ""