i have got to create an array which will stored the answers to my questions any idea on how to do this
9 1246
i have got to create an array which will stored the answers to my questions any idea on how to do this
Hi. Not enough information
What data type will your answers be?
How many answers do you need to store?
i have got to store ten answers. i am making a maths application and everytime they answer a question the question and answer needs to be stored and then produced on the answer page
i have got to store ten answers. i am making a maths application and everytime they answer a question the question and answer needs to be stored and then produced on the answer page
and what type of data is the answer? is it an integer, float, string?
interger. you have to add a and b together to create the maths results
interger. you have to add a and b together to create the maths results
ok. here is a code snippet that will help you on your way - int a;
-
int b;
-
int result[10];
-
for (int i = 0; i < 10; i++) {
-
cout << "Input the first number for sum " << i + 1;
-
cin >> a;
-
cout << "Input the second number for sum " << i + 1;
-
cin >> b;
-
result[i] = a + b;
-
}
ok. here is a code snippet that will help you on your way - int a;
-
int b;
-
int result[10];
-
for (int i = 0; i < 10; i++) {
-
cout << "Input the first number for sum " << i + 1;
-
cin >> a;
-
cout << "Input the second number for sum " << i + 1;
-
cin >> b;
-
result[i] = a + b;
-
}
Will that really help much in the VB forum? Looks like Java, to me. Here's a quick attempt at a VB6 translation. For VB.Net, don't ask me. :) -
Dim a As Integer
-
Dim b As Integer
-
Dim result(1 To 10) As Integer
-
For i = 1 To 10
-
a = Cint(InputBox("Input the first number for sum" & i))
-
b = Cint(InputBox("Input the second number for sum" & i))
-
result(i) = a + b
-
Next
P.S. This was just done on the fly in the editor here, so may need some debugging.
Will that really help much in the VB forum? Looks like Java, to me.
Oops. glad someone is cleaning up after me. I thought I was answering a c++ question.
Oops. glad someone is cleaning up after me. I thought I was answering a c++ question.
Well, I supose not knowing c++, it's simpler for me. I just read the message and if my reaction is "what the bleep does that mean?" then something's wrong (hopefully with the post, and not me). :)
Well, I supose not knowing c++, it's simpler for me. I just read the message and if my reaction is "what the bleep does that mean?" then something's wrong (hopefully with the post, and not me). :)
Well that's me, jack of all trades, master of none :)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Geoff Cox |
last post by:
Hello,
I have a series of pages each of which creates an array of values.
How do I keep all the array values until the last page?
Cheers
Geoff
|
by: Wynand Winterbach |
last post by:
I think every C programmer can relate to the frustrations that malloc
allocated arrays bring. In particular, I've always found the fact that
the size of an array must be stored separately to be a...
|
by: arkobose |
last post by:
my earlier post titled:
"How to input strings of any lengths into arrays of type: char
*array ?"
seems to have created a confusion. therefore i paraphrase my problem
below.
consider the...
|
by: Sukh |
last post by:
I have to design a "Online Test Application" and application is going
to display question and answers.All the questons are objective type so
there is four answer for each question.
My Question is...
|
by: Sukh |
last post by:
I have to design a "Online Test Application" and application is going
to display question and answers.All the questons are objective type so
there is four answer for each question.
My Question is...
|
by: redefined.horizons |
last post by:
I would like to have an array declaration where the size of the array
is dependent on a variable. Something like this:
/* Store the desired size of the array in a variable named
"array_size". */...
|
by: per9000 |
last post by:
Hi all,
I have a two-dimensional array of data, f.x int's. We can imagine that
the array is "really large". Now I want the data in it and store this
in a one-dimensional array.
The obvious...
|
by: alternative451 |
last post by:
Hi, I have just one question :
how to know the size of an array, i have un little program, i use
first static, ant i can use sizeof() to know the size,
but when i put it as paremeter in the...
|
by: nicnac |
last post by:
Hi,
I'm self learning javascript - so any pointers are welcomed!!
I have an issue passing a form and array from one function to another.
I tried many variations !
I can't get this to work...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |