473,385 Members | 1,829 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,385 software developers and data experts.

Array of Objects, what is it? ASAP

10
no code to see, but my professor wants an array of objects rather than 3 parallel arrays. i dont need another way to do the same problem or something fancy, it is an introductory course. all i need to know is what an array of objects is and how it works. I have looked in my book and on other online sources nothing is giving me a clear answer.

Possibly a simple program with them in use, i think this would be most helpful
Jul 15 '08 #1
4 1385
gpraghuram
1,275 Expert 1GB
As for as i know array of onjects would be in arr[3].
Here is consider int as the object.
I am not getting ur question fully.


Raghu
Jul 15 '08 #2
mwhit74
10
As for as i know array of onjects would be in arr[3].
Here is consider int as the object.
I am not getting ur question fully.


Raghu
ok here i will quote the assignment, "Project 3" in the quote is a previous project but it really doesn't matter.

"1. Rewrite Project 3 using an array of object, rather than the three parallel arrays of Project 3.

Create a class named inventory , there are 3 data fields: itemId, storeNr, and quantity. Design the necessayr header file and implementation file."

further down the assignment she defines some of the variables we are supposed to use and 3 functions we are supposed you use in the program.

this is the part i am confused about. can you tell whay you would think a professor would want.
Jul 15 '08 #3
gpraghuram
1,275 Expert 1GB
Sorry,,,
I am not able to get a clear difference between array of object and three parallel arrays of Project.

Raghu
Jul 15 '08 #4
JosAH
11,448 Expert 8TB
ok here i will quote the assignment, "Project 3" in the quote is a previous project but it really doesn't matter.

"1. Rewrite Project 3 using an array of object, rather than the three parallel arrays of Project 3.

Create a class named inventory , there are 3 data fields: itemId, storeNr, and quantity. Design the necessayr header file and implementation file."

further down the assignment she defines some of the variables we are supposed to use and 3 functions we are supposed you use in the program.

this is the part i am confused about. can you tell whay you would think a professor would want.
You have probably done the following in your previous project:

Expand|Select|Wrap|Line Numbers
  1. /* <max_value> is some positive value */
  2. int itemId[<max_value>];
  3. int storeNr[<max_value>];
  4. int quantity[<max_value>];
  5.  
Now the assignment wants you to design a small class named 'inventory' such
that you can do this:

Expand|Select|Wrap|Line Numbers
  1. /* <max_value> is some positive value */
  2. inventory items[<max_value>];
  3.  
kind regards,

Jos
Jul 15 '08 #5

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

Similar topics

3
by: Pol Bawin | last post by:
Hi All, One : I have a property that get/set a array of an abstract class A By default my array is null In the propertygrid, It is not works correctly when my array is null. (when my array...
19
by: Tom Jastrzebski | last post by:
Hello, I was just testing VB.Net on Framework.Net 2.0 performance when I run into the this problem. This trivial code attached below executed hundreds, if not thousand times faster in VB 6.0...
21
by: yeti349 | last post by:
Hi, I'm using the following code to retrieve data from an xml file and populate a javascript array. The data is then displayed in html table form. I would like to then be able to sort by each...
1
by: Massimo Bonanni | last post by:
Hi, I try to implement ASAP protocol in my web service, but I find a very hard problem. I define my SOAP Header: public class Request : SoapHeader {
3
by: XML newbie: Urgent pls help! | last post by:
Does anyone have a snippet of code that will convert a string array to a long array? I've nearly smashed my head against the wall trying to figure this out. I'm Using vb.net 2005 Pls reply...
7
by: heddy | last post by:
I have an array of objects. When I use Array.Resize<T>(ref Object,int Newsize); and the newsize is smaller then what the array was previously, are the resources allocated to the objects that are...
2
by: JJA | last post by:
I'm looking at some code I do not understand: var icons = new Array(); icons = new GIcon(); icons.image = "somefilename.png"; I read this as an array of icons is being built. An element of...
5
by: Ranmini | last post by:
Dear prob solver, i have a problem with array lists. i am using array lists for adding objects. i just want to know, when you are adding an object to an arraylist whats the value u pass to the...
2
by: StevenChiasson | last post by:
For the record, not a student, just someone attempting to learn C++. Anyway, the problem I'm having right now is the member function detAddress, of object controller. This is more or less, your...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.