Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Who can figuer this one out?

Author  Topic 

osirisa
Constraint Violating Yak Guru

289 Posts

Posted - 2008-07-10 : 21:15:02
Program #1)
Create an application that takes an unknown set of 5 numbers and displays the next 100 multiples of each on the console window. Hard code of the numbers in the code is not permitted. Input of multiple sets of numbers is determined by the developer (IE via a configuration file, command line argument, database, etc). Display of multiples needs to be “<a> x <y> = <z>”. Mixing numbers across multiple sets is not permitted

I.E.: 5 numbers are 1, 2, 3, 4, 5

The first 5 rows for #2 would be
2 x 1 = 2
2 x 2 = 4
2 x 3 = 6
2 x 4 = 8
2 x 5 = 10

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-07-10 : 22:23:21
use CROSS JOIN


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

osirisa
Constraint Violating Yak Guru

289 Posts

Posted - 2008-07-10 : 22:51:39
what about in a VB.Net Program Code?
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-07-10 : 22:55:13
basically 2 for loop iterating all permutation lah


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

osirisa
Constraint Violating Yak Guru

289 Posts

Posted - 2008-07-10 : 22:56:41
:) is that english?
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-07-10 : 23:01:28
quote:
Originally posted by osirisa

:) is that english?




Singlish lah


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2008-07-11 : 09:23:24
quote:
Originally posted by osirisa

Program #1)
Create an application that takes an unknown set of 5 numbers and displays the next 100 multiples of each on the console window. Hard code of the numbers in the code is not permitted. Input of multiple sets of numbers is determined by the developer (IE via a configuration file, command line argument, database, etc). Display of multiples needs to be “<a> x <y> = <z>”. Mixing numbers across multiple sets is not permitted

I.E.: 5 numbers are 1, 2, 3, 4, 5

The first 5 rows for #2 would be
2 x 1 = 2
2 x 2 = 4
2 x 3 = 6
2 x 4 = 8
2 x 5 = 10




What is this question for? A job interview? if you don't know the answer, then you probably should not be getting the job, right?

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page

osirisa
Constraint Violating Yak Guru

289 Posts

Posted - 2008-07-13 : 22:53:25
LOLOLOLOL :)
Go to Top of Page
   

- Advertisement -