|
-
Jan 5th, 2015, 05:30 AM
#1
Thread Starter
New Member
Coding problem
Dear All,
S.No. Input Input Output
1 A B A*B
2 A B A*B
3 A B A*B
4 A B A*B
5 A B A*B
Sum(1+2+3+4+5)
Can you suggest the coding in VB??
Last edited by Vin7743; Jan 6th, 2015 at 06:26 AM.
-
Jan 5th, 2015, 09:09 AM
#2
The best argument against democracy is a five minute conversation with the average voter - Winston Churchill
Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd
-
Jan 5th, 2015, 09:55 AM
#3
Re: Coding problem
This post gets my vote as the best question for 2015 .... and we are only 5 days in!
More seriously though your post read a bit like this
"Morning I am trying to build a spaceship
bluetack
cardboard
sequines
Thanks"
Maybe you should read this
Please Mark your Thread "Resolved",  if the query is solved & Rate those who have helped you
-
Jan 6th, 2015, 06:22 AM
#4
Thread Starter
New Member
Re: Coding problem
Dear all,
I want in promgram in which the input value is A and B and outpu tvalue is Multiple of A and B (A*B) and sum of output
S.No. Input Input Output
1 A B A*B
2 A B A*B
3 A B A*B
4 A B A*B
5 A B A*B
Sum(1+2+3+4+5)
Can you suggest the coding in VB ????
-
Jan 6th, 2015, 06:52 AM
#5
Re: Coding problem
have you got your supply of sequins yet? What about blue-tack?
because there is no way we can help you build your spaceship without them !!
Please Mark your Thread "Resolved",  if the query is solved & Rate those who have helped you
-
Jan 6th, 2015, 07:53 AM
#6
Re: Coding problem
Vin - you need to provide a CLEAR and accurate description of what you're trying to do. Please keep in mind we are not clairvoyant, nor are we sitting in your lap, so we only know what you're telling us. And at this point, it isn't very much. There's no context to the problem at hand. Is it in a database? Is this in a loop? How are you getting the data? Is it in a datatable? Is it in a text file? Is it in 15 different variables? And array? The answer on how to solve the problem is going to depend on things like that. So far, all you've managed to do is walk into the mechanic's shop, point at your car and say "It broke. It no worky worky." There's no context as to what the problem is (you drove your car in to a tree! - of course it's not going to work!)
-tg
-
Jan 6th, 2015, 02:30 PM
#7
Hyperactive Member
Re: Coding problem
I think I have a very basic grasp of what Vin is asking for, but still not much. If I understand correctly, the user will be inputting two numbers (input how? and what data-type?) A and B (may want more expressive names). The program will then get a product of those two numbers and display this as output (in what way? MessageBox? Form control? Console output?). Additionally, there is to be the sum of all products also outputted (Continuous looping until an exit code is entered by user? A specific number of products? Or just keep a running tally each time a new product of numbers is requested?). However as you can see even with my questions, there is still a lot of unknowns... Even some context might make it a little easier to understand. Are you trying to write a shopping cart type of program where A is the quantity, B is the unit price, and the sum is the total cost of the order?
Moreover, this forum is for help with specific questions about a specific piece of code. We are not being paid, so we do not write other's code for them. So even if all of these questions are answered, we still have not been shown any code to see where you are going wrong, and we are not here to build a complete project from scratch.
-
Jan 7th, 2015, 03:36 AM
#8
Re: Coding problem
Do you mean:
You want to enter the values of:
A1, B1
A2, B2
A3, B3
A4, B4
A5, B5
Then do this?
Sum((A1*B1)+(A2*B2)+(A3*B3)+(A4*B4)+(A5*B5))
Kris
-
Jan 7th, 2015, 09:07 AM
#9
Thread Starter
New Member
Re: Coding problem
Dear Pythoo7,
hi,
Thanks for your understanding, your are absolutly right i ma trying to writh shoppig cart promgram in which A is Qty and B is Untiprice and the sum is = Total , in addition of my query is i want 5 to 10 items in a row and the sum of all items totals
I am make the program in VB 2010 and for database i used SQL server , my problem it is working ok for single itemsBut I need in 5 - 10 items in a row
Can you give any suggestion
Vin
-
Jan 7th, 2015, 09:09 AM
#10
Thread Starter
New Member
Re: Coding problem
Kris,
Thanks for your understanding, your are absolutly right i ma trying promgram in which A is Qty and B is Untiprice and the sum is = Total , in addition of my query is i want 5 to 10 items in a row and the sum of all items totals
I am make the program in VB 2010 and for database i used SQL server , my problem it is working ok for single itemsBut I need in 5 - 10 items in a row
Can you give any suggestion??
Vin
-
Jan 7th, 2015, 09:11 AM
#11
Thread Starter
New Member
Re: Coding problem
hi,
I want to enter the values of:
A1, B1
A2, B2
A3, B3
A4, B4
A5, B5
And then the sum of all
Sum((A1*B1)+(A2*B2)+(A3*B3)+(A4*B4)+(A5*B5))
Is it clear for you?
-
Jan 7th, 2015, 09:32 AM
#12
Re: Coding problem
Yes & No !
Vin we already understood the logic problem, that is not what everyone has been trying to get through to you!
Post your code !!!!
Please Mark your Thread "Resolved",  if the query is solved & Rate those who have helped you
-
Jan 7th, 2015, 10:08 AM
#13
Re: Coding problem
The logic is fine... and only part of the issue... but we also need to know how the data is entered and stored... I can give you a SQL solution, but unless the data is in a table in a database, the solution is useless.
-tg
-
Jan 9th, 2015, 04:53 PM
#14
Hyperactive Member
Re: Coding problem
can I suggest you either make a custom control.
With the following properties:
-Quantity (Self Explanatory)
-Unit Price (Self Explanatory)
-TotalPrice (readonly)
Get
Return Me.UnitPrice * Me.Quantity
End Get
then to get a total do the following
Dim running_total as decimal
for each control in me. controls if typeof control is Custom Type then
running_total += control.TotalPrice
next
Last edited by Leary222; Jan 9th, 2015 at 04:54 PM.
Reason: missed information
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|