473,791 Members | 3,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parallel array

1 New Member
Hello to everyone,
I have to do a project in my discovering programming class based on creating parallel arrays for an order form. I am still not completely sure was a parallel array is! But basically any help, tips, pr tricks would help. My program is to allow the user to enter the name of a product, the product number or serial number, the quantity, and the cost per item and have them all displayed in different parrallel arrays. the program is also to calculate the total cost of this order in another seperate parallel array...again any responce would be helpful.
Jan 25 '07 #1
1 1806
willakawill
1,646 Top Contributor
Hi, a parallel array is one with the same number of elements as another array so that the same element for each array can be accessed in the same loop. A better way is to create a structure containing all of the types of data and creating an array of that structure. e.g. the parallel way

Expand|Select|Wrap|Line Numbers
  1. Dim ar1(25) As Integer
  2. Dim ar2(25) As Double
  3. Dim lp As Long
  4.  
  5. For lp = 0 To 25
  6.    ar1(lp) = lp
  7.    ar2(lp) = lp * 1.0
  8. Next lp
And the structure way
Expand|Select|Wrap|Line Numbers
  1. Private Type mydata
  2.    IDNo As Long
  3.    Cost As Double
  4. End Type
  5.  
  6. Dim MyData(25) As mydata
  7. Dim lp As Long
  8.  
  9. For lp = 0 To 25
  10.    MyData.IDNo = lp
  11.    MyData.Cost = lp * 1.0
  12. Next lp
Jan 27 '07 #2

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

Similar topics

0
1749
by: Markus Franz | last post by:
Hi. I have a difficult problem: An array contains several different URLs. I want to load these websites in parallel by using a HTTP-Request. How can I do this in PHP? Up to now I did this with an external Python script because Python offers process control functions. But in PHP only exist restricted possibilities for using threads / processes.
6
3532
by: Xiaozhu | last post by:
say, if you had parallel arrays containing the sales person id, the month, and the sales figures (for that person in that month), sorting on sales figure and preserve the order of figures within the data about the same person: Original Data: id month sales +-----+ +-----+ +-----+ | 432 | | 8 | | 89 | +-----+ +-----+ +-----+ | 123 | | 8 | | 116 |
10
4985
by: bpontius | last post by:
The GES Algorithm A Surprisingly Simple Algorithm for Parallel Pattern Matching "Partially because the best algorithms presented in the literature are difficult to understand and to implement, knowledge of fast and practical algorithms is not commonplace." Hume and Sunday, "Fast String Searching", Software - Practice and Experience, Vol. 21 # 11, pp 1221-48
11
5284
by: Timothy Smith | last post by:
hello people. i've been trying to send an 8 byte string to my parallel port under freebsd. the purpose is it to control a relay board. the board simply responds to the output byte coming from the port. eg. 00000001 will set pin 1 high and flick the relay open. todate i've attempted this with merely open() on /dev/ppi0 and numpy for the byte array, but i just can't seem to get it working. i know the parallel port works and i know the...
9
1852
by: IamIan | last post by:
I'm using an array to store map features (name, lat, lon, caption, etc), from which the user can then select an individual feature. The problem is that when thousands of features are stored in the array, looping over the entire array looking for a match is SLOW. So I'm running a hash in parallel, where every time a feature is pushed onto the array it's name is also added to the hash as an identical key value pair. I then check if the key...
2
15495
by: simo | last post by:
Hello to all... I am trying to write an algorithm parallel in order to realize the quicksort. They are to the first crews with C and MPI. The algorithm that I am trying to realize is PARALLEL QUICKSORT with REGULAR SAMPLING. The idea on the planning is right. the code that I have written syntactically does not only have problems that it does not want any to know to work... Are two days that I analyze it but I do not succeed to find the...
2
2291
by: dejavu33 | last post by:
Hello! Im learning arrays and am having trouble with parallel arrays. I dont understand exactly what they are. Can anyone give me an explanation of what they are or maybe how they can be declared or a small example...anything to help me understand parallel arrays? Thank you.
1
1992
by: joor | last post by:
Hi I am a beginner and currently trying to create a small program. I seem to be stuck on the multiplication of their elements. Eg. I have an Array with 4 different prices for 4 different products and have created 2 other Arrays to which I have assigned values through window.prompt(parseFloat) , what I am trying to do is multiplicate the values on the parallel arrays by their corresponding indexes and keep a running total so I can have an...
0
9669
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9517
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10428
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10156
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9997
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9030
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
4110
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.