Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old December 6th, 2006, 02:05 PM
sunny
Guest
 
Posts: n/a
Default A sample program to implement a factory design pattern

Hai,

can anyone implemen this problem.I am unable to implement.i tried but i
am going out of the design pattern.

Implement the Factory Design Pattern for the following scenario:
Base class = Quad
Derived classes = Square, Rectangle
Take command line arguments for length & width. Depending upon no. of
arguments,
create and return the object of appropriate derived class. Each class
should have a
function named "desc" to print the class name. Base class should be
abstract.

Kindly find me the solution for this problem

Thanking You,
K.RajaSekhar

  #2  
Old December 6th, 2006, 02:55 PM
Jim Langston
Guest
 
Posts: n/a
Default Re: A sample program to implement a factory design pattern

"sunny" <kavuri.rajasekhar@gmail.comwrote in message
news:1165415322.673142.117600@80g2000cwy.googlegro ups.com...
Quote:
Hai,
>
can anyone implemen this problem.I am unable to implement.i tried but i
am going out of the design pattern.
>
Implement the Factory Design Pattern for the following scenario:
Base class = Quad
Derived classes = Square, Rectangle
Take command line arguments for length & width. Depending upon no. of
arguments,
create and return the object of appropriate derived class. Each class
should have a
function named "desc" to print the class name. Base class should be
abstract.
>
Kindly find me the solution for this problem
>
Thanking You,
K.RajaSekhar
Sorry, we won't do your homework for you. And repeating the same quesiton 3
times isnt' going to help.

Show us what you've tried that didnt work. Show us code.


  #3  
Old December 6th, 2006, 03:35 PM
dongjf@gmail.com
Guest
 
Posts: n/a
Default Re: A sample program to implement a factory design pattern

Yes, everyone should do his homework by himself.
"Jim Langston дµÀ£º
"
Quote:
"sunny" <kavuri.rajasekhar@gmail.comwrote in message
news:1165415322.673142.117600@80g2000cwy.googlegro ups.com...
Quote:
Hai,

can anyone implemen this problem.I am unable to implement.i tried but i
am going out of the design pattern.

Implement the Factory Design Pattern for the following scenario:
Base class = Quad
Derived classes = Square, Rectangle
Take command line arguments for length & width. Depending upon no. of
arguments,
create and return the object of appropriate derived class. Each class
should have a
function named "desc" to print the class name. Base class should be
abstract.

Kindly find me the solution for this problem

Thanking You,
K.RajaSekhar
>
Sorry, we won't do your homework for you. And repeating the same quesiton 3
times isnt' going to help.

Show us what you've tried that didnt work. Show us code.
  #4  
Old December 6th, 2006, 06:47 PM
Default User
Guest
 
Posts: n/a
Default Re: A sample program to implement a factory design pattern

dongjf@gmail.com wrote:
Quote:
Yes, everyone should do his homework by himself.
Please don't top-post. Your replies belong following or interspersed
with properly trimmed quotes. See the majority of other posts in the
newsgroup, or the group FAQ list:
<http://www.parashift.com/c++-faq-lite/how-to-post.html>
  #5  
Old December 6th, 2006, 09:06 PM
BobR
Guest
 
Posts: n/a
Default Re: A sample program to implement a factory design pattern


Jim Langston wrote in message ...
Quote:
>"sunny" <kavuri.rajasekhar@gmail.comwrote in message ...
Quote:
>Hai,
>can anyone implemen this problem.I am unable to implement.i tried but i
>am going out of the design pattern.
>Implement the Factory Design Pattern for the following scenario:
>Base class = Quad
>Derived classes = Square, Rectangle
>Take command line arguments for length & width. Depending upon no. of
>arguments,
>create and return the object of appropriate derived class. Each class
>should have a
>function named "desc" to print the class name. Base class should be
>abstract.
>Kindly find me the solution for this problem
>Thanking You,
>K.RajaSekhar
>
>Sorry, we won't do your homework for you.
Speak for yourself, Jim! I'll do it for $300.us a kloc (not in my compact
format.).
<G>
--
Bob R
POVrookie


  #6  
Old December 6th, 2006, 09:15 PM
IR
Guest
 
Posts: n/a
Default Re: A sample program to implement a factory design pattern

BobR wrote:
Quote:
Jim Langston wrote in message ...
[...]
Quote:
Quote:
>>Sorry, we won't do your homework for you.
>
Speak for yourself, Jim! I'll do it for $300.us a kloc (not in my
compact format.).
$300/kloc is cheap. I'd call that disloyal competition! :p


Cheers,
--
IR
  #7  
Old December 6th, 2006, 11:25 PM
BobR
Guest
 
Posts: n/a
Default Re: A sample program to implement a factory design pattern


IR wrote in message ...
Quote:
>BobR wrote:
Quote:
>Jim Langston wrote in message ...
>[...]
Quote:
Quote:
>>>Sorry, we won't do your homework for you.
>>
>Speak for yourself, Jim! I'll do it for $300.us a kloc (not in my
>compact format.).
>
>$300/kloc is cheap. I'd call that disloyal competition! :p
I count the lines in the included system headers!! <G>

#include <iostream>
#include <ostream>
#include <string>

int main(){
std::cout<<std::string("Hello Student\n");
std::cout<<"You owe me $300.us!"<<std::endl;
return 0;
}

I need the bucks!
[ government: move decimal point one or two places to right!
I want some of that porkbarrel $s! ]
--
Bob R
POVrookie


  #8  
Old December 7th, 2006, 04:35 PM
RKS
Guest
 
Posts: n/a
Default Re: A sample program to implement a factory design pattern

can anyone implemen this problem.I am unable to implement.i tried but i
Quote:
am going out of the design pattern.
Why dont you show the code that you have tried. Someone may be able to
help you.
Quote:
Implement the Factory Design Pattern for the following scenario:
Base class = Quad
Derived classes = Square, Rectangle
Take command line arguments for length & width. Depending upon no. of
arguments,
create and return the object of appropriate derived class. Each class
should have a
function named "desc" to print the class name. Base class should be
abstract.
Just type "Design patterns using C++" in Google and see the number of
links you get. I think the very first one is good enough.
Quote:
Kindly find me the solution for this problem
You have work out the solution. You can only ask assistance if you run
in to problems. No one is going to do your homework.

 

Bookmarks

Thread Tools

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles