473,395 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Print out a list

First off I have 3 classes, the first is the one with my main in, in here I make variables of the type that is the first class which I have called "Group". so I make groupA and groupB.
Then in my group class I make a list of the last class that I have called names.
In this class I have the variables string name and int age.

so I add a person to groupA and groupB and wanna print out every person on each list. how do I do this?
Apr 12 '10 #1
3 13988
tlhintoq
3,525 Expert 2GB
Bytes has a policy regarding assisting students with their homework.

The short version is that the volunteers here can't help you with schoolwork.
A) We don't know what material you have and have not learned in class.
B) We don't know the guidelines you must follow.
C) In the long run giving you the answers actually short changes your education.

Hint 1: Try hitting Google with terms of your programming language and primary terms of what you want to do. For example "C# custom events" or "VB datagrid Excel". I've found this to be a very effective tool.
Hint 2: Your text book
Hint 3: Your instructor
Hint 4: Posting guidelines regarding homework assignments.
Apr 12 '10 #2
jkmyoung
2,057 Expert 2GB
foreach loop? Not enough code provided.
Expand|Select|Wrap|Line Numbers
  1. foreach (Person p in names){
  2.   Console.Write(p.name);
  3. }
Apr 13 '10 #3
Frinavale
9,735 Expert Mod 8TB
Overwrite the ToString method and do as jkmyoung has suggested....
Apr 13 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: flupke | last post by:
Hi, i'm having trouble with deleting elements from a list in a for loop ============== test program ============== el = print "**** Start ****" print "List = %s " % el index = 0 for line...
7
by: Bob Smith | last post by:
Hi, I have a Python list. I can't figure out how to find an element's numeric value (0,1,2,3...) in the list. Here's an example of what I'm doing: for bar in bars: if 'str_1' in bar and...
2
by: Dan Williams | last post by:
Does anyone know if there's an SQL command i can run that will list the tables in a database that have an identity column set to NOT FOR REPLICATION? Many thanks Dan Williams.
2
by: Aaron | last post by:
I have a data sructure setup and I populate it in a loop like so: y=0 while X: DS.name = "ASDF" DS.ID = 1234 list = DS; y = y + 1
33
by: junky_fellow | last post by:
Consider a singly-linked list. Each node has a structure, struct node { char c; struct node *next; }; Each of the nodes contain an alphabetic character. Can anybody suggest a way to print...
0
by: Bob | last post by:
I need to print a list of .PDF documents in the order that they are submitted. Previously the print queue has taken the documents in an arbitrary order. Does anyone have .NET code that will force...
7
by: Brian | last post by:
First off, I am sorry for cluttering this group with my inept questions, but I am stuck again despite a few hours of hair pulling. I have a function (below) that takes a list of html pages that...
4
by: QQ | last post by:
Hi Here is part of my code typedef struct{ int len; char code; }Code; typedef struct{ .... Code *a;
1
by: scion111 | last post by:
Is there a way to create a report that documents all of the joins in a database and their type? When looking in the relationships window, all you can see is that a join is one to many etc. What I'd...
1
by: jacobevans | last post by:
I am trying to print a list to a caption. Say the list contained One, Two, and Three. When i click a command button the caption should say "One, Two, Three" Is there any simple way to do this? I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.