Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 22nd, 2004, 10:38 AM
Authorized User
 
Join Date: Jul 2004
Location: Saint Peters, Missouri, USA.
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default Beginning Visual C# Exercises - Chapter 08

1. Public, Private and Protected

2. False, although, when resources are critical, calling a destructor is more timely

3. No, static properties, fields and methods may be independent of object instances

4.
Code:
                   |---------------|
                   |  HotDrink     |
                   |---------------|
                   |  Milk         |             |---------------|
                   |  Sugar        |             | <<Interface>> |
                   |---------------|             |    ICup       |
                   |  Drink()      |             |---------------|
                   |  AddMilk()    |             |  Color        |
                   |  AddSugar()   |             |  Volume       |
                   |---------------|             |---------------|
                           ^                     |  Refill()     |
                           |                     |  Wash()       |
                           |                     |---------------|
           |-----------------------------|
           |                             |
           |                             |
   |---------------|           |---------------|
   |  CupOfCoffee  |---() ICup |  CupOfTea     |---() ICup
   |---------------|           |---------------|
   |  BeanType     |           |  LeafType     |
   |---------------|           |---------------|
   |               |           |               |
   |---------------|           |---------------|
5. private void slakeThirst(object beverage)
        {
            // Employ interface polymorphism
            ICup glassWare;
            glassWare = beverage;
            glassWare.AddMilk();
            glassWare.Drink();
            glassWare.Wash();
        }
Reply With Quote
  #2 (permalink)  
Old July 22nd, 2004, 12:04 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Wow, cool ASCI art.

Unfortunately I don't have the book, so I cannot say whether your design is correct or not.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #3 (permalink)  
Old July 26th, 2004, 07:11 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

Steven, you are doing a great favor to the readers of this book, I appreciate your efforts and kindheartedness.

Ankur
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginning Visual C# Exercises - Chapter 05 seblake C# 1 July 26th, 2004 07:40 AM
Beginning Visual C# Exercises - Chapter 04 seblake C# 0 July 21st, 2004 09:21 AM
Beginning Visual C# Exercises - Chapter 07 seblake C# 0 July 20th, 2004 02:07 PM
Beginning Visual C# Exercises - Chapter 06 seblake C# 1 July 19th, 2004 09:15 AM



All times are GMT -4. The time now is 09:57 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.