1. Trang chủ
  2. » Địa lý lớp 12

Lập trình hướng đối tượng: Workshop 8

2 9 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 2
Dung lượng 54,79 KB

Nội dung

• void display() const - a query that displays the phone number in CCC-AAA- LLLLLLL Subscriber format, where CCC denotes country code, AAA denotes area code within a country or r[r]

(1)

Part D – Inheritance Workshop 7 LEARNING OUTCOME

Upon successful completion of this workshop, you will have demonstrated the abilities to

• derive one class from another class

• design a derived class that accesses a resource Phone Number with Subscriber

Derive from your IntlPhoneNumber class a class named IntlPhoneNumberWS for international phone numbers Your derived class holds information that includes the name of the subscriber Upon instantiation, an IntlPhoneNumberWS object may receive an integer identifying the country or region code, an integer identifying the area code within the country or region, an integer identifying the local telephone number within the area code and the name of the subscriber If the object does not receive any number, or does not receive a valid number, the object adopts a safe empty state

Your IntlPhoneNumberWS class includes the following member function:

void setSubscriber(char*) – a modifier that set value for the name of subscriber

void display() const - a query that displays the phone number in CCC-AAA-LLLLLLL Subscriber format, where CCC denotes country code, AAA denotes area code within a country or region, LLLLLLL denotes local number and Subscriber

denotes the name of the subscriber

For the purpose of this workshop, you may assume that the user will input the data correctly The output from your program should look something like:

(2)

Ngày đăng: 09/03/2021, 04:09

w