ZBLOG

1.Manny, the Royal Service Station manager, is going to expand his services to include an automated car washing system. The customer chooses the type of wash and specifies the type of car. The system computes the fee and displays the amount due on...

We can add a new class called “AutomatedCarWash” and connect it to the “Customer” class through an association. The “AutomatedCarWash” class will have attributes such as “washType” and “carType”, as well as methods for computing the fee and indicating if the wash is busy or not. The “ControlPanel” class can also be updated to display the amount due for the car wash selected by the customer. The updated UML class diagram would look something like this:

+-----------------+        +------------------+
|    Customer     |        | AutomatedCarWash |
+-----------------+        +------------------+
| -name: String   |<>------| -washType: String |
| -phoneNumber:   |        | -carType: String  |
|   String        |<>------|                  |
+-----------------+        | +computeFee():    |
                           |  float           |
                           | +isBusy(): Boolean|
                           +------------------+

+---------------+
| ControlPanel  |
+---------------+
|               |
+---------------+

本站部分文章来源于网络,版权归原作者所有,如有侵权请联系站长删除。
转载请注明出处:https://golang.0voice.com/?id=5242

分享:
扫描分享到社交APP
上一篇
下一篇
发表列表
游客 游客
此处应有掌声~
评论列表

还没有评论,快来说点什么吧~

联系我们

在线咨询: 点击这里给我发消息

微信号:3007537140

上班时间: 10:30-22:30

关注我们
x

注册

已经有帐号?