Click here to Skip to main content
15,867,985 members
Home / Discussions / C#
   

C#

 
AnswerRe: Removing duplicates / extracting unique vals from String array [modified] Pin
DaveyM6922-Jan-11 5:47
professionalDaveyM6922-Jan-11 5:47 
GeneralRe: Removing duplicates / extracting unique vals from String array Pin
Mirko198024-Jan-11 22:11
Mirko198024-Jan-11 22:11 
QuestionPlease Check Pin
M Riaz Bashir21-Jan-11 23:25
M Riaz Bashir21-Jan-11 23:25 
AnswerRe: Please Check Pin
OriginalGriff21-Jan-11 23:42
mveOriginalGriff21-Jan-11 23:42 
GeneralRe: Please Check Pin
M Riaz Bashir21-Jan-11 23:48
M Riaz Bashir21-Jan-11 23:48 
GeneralRe: Please Check Pin
Henry Minute22-Jan-11 4:00
Henry Minute22-Jan-11 4:00 
AnswerRe: Please Check Pin
_Erik_24-Jan-11 3:43
_Erik_24-Jan-11 3:43 
Questioni want to solve this Pin
Nabawoka21-Jan-11 22:21
Nabawoka21-Jan-11 22:21 
Given these interfaces:
// Simple class that computes a result from two values.
interface IThing {
// Set values from which Result is computed.
void Initialize(int value1, int value2);
int Result { get; }
}
// Contains IThings in named groups.
interface IThingManager {
// Add 'thingToAdd' to group named 'groupName'.
// Create new group 'groupName' if it doesn't exist.
void AddThing(string groupName, IThing thingToAdd);
// Compute sum of all IThings added to group 'groupName'.
int Sum(string groupName);
// Compute sum of all IThings added to all groups.
int TotalSum();
// Output text summary of the IThings contained in this IThingManager.
// (Text can be output using System.Console.WriteLine).
void Print();
}
Write an implementation of the interfaces in these concrete classes:
// Result is the product of value1 and value2, as supplied in the
// ``Initialize`` method.
class MultiplierThing : IThing { ... }
// Result is the sum of value1 and value2.
class AdderThing : IThing { ... }
class ThingManager : IThingManager {
...
// Print: For each group, outputs the sum of the IThings in that group.
// Also output the total sum of all groups.
void Print() { ... }
}
//Inherit VerboseThingManager from ThingManager, and change the functionality of the Print //method to the following:
//1 For each group, output the name of that group, and a list of all members of that group.
//2 Also output the sums like the Print method of ThingManager.
Example Ouput
Given a main program like this:
IThingManager manager = new VerboseThingManager();
IThing t;
t = new MultiplierThing();
t.Initialize(1, 2);
manager.AddThing("Group A", t);
t = new MultiplierThing();
t.Initialize(3, 4);
manager.AddThing("Group B", t);
t = new AdderThing();
t.Initialize(5, 6);
manager.AddThing("Group A", t);
t = new AdderThing();
t.Initialize(7, 8);
manager.AddThing("Group B", t);
manager.Print();
The corresponding output should be:
Group A:
- 2
- 11
Group B:
- 12
- 15
Sum of Group A = 13
Sum of Group B = 27
Total sum = 40


Please Help me
i made the classes of adderthing & MultiplierThing that inherits from interface IThing and stop
AnswerRe: i want to solve this Pin
Richard MacCutchan21-Jan-11 22:35
mveRichard MacCutchan21-Jan-11 22:35 
GeneralRe: i want to solve this Pin
Nabawoka21-Jan-11 22:39
Nabawoka21-Jan-11 22:39 
AnswerRe: i want to solve this Pin
Nabawoka21-Jan-11 22:55
Nabawoka21-Jan-11 22:55 
GeneralRe: i want to solve this Pin
Estys21-Jan-11 23:00
Estys21-Jan-11 23:00 
GeneralRe: i want to solve this Pin
Nabawoka22-Jan-11 0:02
Nabawoka22-Jan-11 0:02 
AnswerRe: i want to solve this Pin
Estys22-Jan-11 0:30
Estys22-Jan-11 0:30 
GeneralRe: i want to solve this Pin
OriginalGriff22-Jan-11 0:41
mveOriginalGriff22-Jan-11 0:41 
GeneralRe: i want to solve this Pin
Dave Kreskowiak22-Jan-11 9:03
mveDave Kreskowiak22-Jan-11 9:03 
GeneralRe: i want to solve this Pin
Estys22-Jan-11 11:26
Estys22-Jan-11 11:26 
AnswerRe: i want to solve this Pin
Estys21-Jan-11 23:00
Estys21-Jan-11 23:00 
Questionhow to run a sever when the IIS runs? Pin
xaq69388826521-Jan-11 21:55
xaq69388826521-Jan-11 21:55 
AnswerRe: how to run a sever when the IIS runs? Pin
R. Giskard Reventlov21-Jan-11 22:12
R. Giskard Reventlov21-Jan-11 22:12 
QuestionMAPI Windows Live mail Pin
M Riaz Bashir21-Jan-11 20:31
M Riaz Bashir21-Jan-11 20:31 
AnswerRe: MAPI Windows Live mail Pin
dan!sh 21-Jan-11 22:00
professional dan!sh 21-Jan-11 22:00 
GeneralRe: MAPI Windows Live mail Pin
M Riaz Bashir21-Jan-11 22:40
M Riaz Bashir21-Jan-11 22:40 
Questionproblem with capturing images through webcam in win7 Pin
prasadbuddhika21-Jan-11 16:29
prasadbuddhika21-Jan-11 16:29 
AnswerRe: problem with capturing images through webcam in win7 Pin
Luc Pattyn21-Jan-11 17:13
sitebuilderLuc Pattyn21-Jan-11 17:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.