Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 22nd, 2006, 04:03 PM
Registered User
 
Join Date: Jun 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need some more help please

Ok so heres my problem. I need to ...

Add the method AddArtist. This Method will receive the first name (ArtFName), last name (ArtLName) and the artist ID (artID) from the user (in a console app) and pass them along to the Artist constructor.
AddArtist uses the List.Add method to create a new Artist Instance and add it to the Artists Collection. (I am using the OOP technique for this project also)

 This would be greatly appreciated ASAP as I am already super far behind on this project. THANK YOU!!!!
 
Old June 22nd, 2006, 04:25 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Is this a commercial project or your homework?

In the first case, interesting requirements....

In the latter case: do you think it's fair to let us do your homework?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old June 22nd, 2006, 04:31 PM
Registered User
 
Join Date: Jun 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Its actually a project I'm doing for a family member but im running behind on it because of other commitments and ineed help...The requirements might seem interesting but they're not lol...Its a program for a computerized Gallery system ...keeping track of an Art Gallery.

 
Old June 23rd, 2006, 05:24 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
quote:The requirements might seem interesting but they're not lol
The way they were put still make them sound like homework.

ANyway, what part of the assignment are you having problems with? Do you know how to create a method that takes the requested parameters? And do you know how to new up an instance of the Artist?

And what version of C# are you using? You could use generics for the List if you were using C# 2; otherwise, you would need to create a custom collection, or use one of the existing classes.

If you let us know what specific area you have problems with, maybe we can help. I am not going to write the entire code for you, if you don't mind.

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old June 23rd, 2006, 05:34 PM
Registered User
 
Join Date: Jun 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok I'm working in a comsole app at the moment I to Call a method (which i have done) and pass the three variables input by the user (which i have done). I need to know how to store that artist to a collection and i also need to know how to use that collection to display a list of the artists in the collection to the console. I'm using Visual STudio .Net C#.......Its not the @nd edition.
Thanks alot for your help...I dont expect the full coding as I wouldn't learn it at all. But if you could help in anyways that would be great.

 
Old June 25th, 2006, 04:06 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

If you can't use Generics (part of .NET 2) you could use a class like the ArrayList (http://msdn2.microsoft.com/en-us/lib...arraylist.aspx) that allows you to add objects.

Items in an ArrayList can be looped through with a For Each / foreach construct...

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 
Old June 26th, 2006, 03:05 PM
Registered User
 
Join Date: Jun 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ahhh **** i forgot about that. thanks a lot man.










Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.