Click here to Skip to main content
15,896,154 members
Home / Discussions / C#
   

C#

 
AnswerRe: Retrieve workgroup name in C# Pin
Richard Deeming21-Mar-06 2:23
mveRichard Deeming21-Mar-06 2:23 
QuestionMultiDimensional Arraylists question Pin
kpkr20-Mar-06 6:01
kpkr20-Mar-06 6:01 
AnswerRe: MultiDimensional Arraylists question Pin
Steve Hansen20-Mar-06 6:33
Steve Hansen20-Mar-06 6:33 
GeneralRe: MultiDimensional Arraylists question Pin
kpkr20-Mar-06 9:24
kpkr20-Mar-06 9:24 
QuestionFile and Directory Classes Pin
binaryfreak20-Mar-06 4:56
binaryfreak20-Mar-06 4:56 
Questioncombobox usage Pin
bazzanewt20-Mar-06 4:48
bazzanewt20-Mar-06 4:48 
AnswerRe: combobox usage Pin
Gulfraz Khan20-Mar-06 6:22
Gulfraz Khan20-Mar-06 6:22 
QuestionGoostavo Problem solution Pin
rerebest20-Mar-06 3:23
rerebest20-Mar-06 3:23 
please i need the answer for this problem using c#.
i believe it is a very famous one but i can not get the code.
the problem is down here




Problem:
Christmas is near, and Goostavo is preparing to buy Chriastmas presents!
He has one problem though, and you will have to help him with that.
Goostavo still doesn't know for how many people is he going to buy
presents. He also doesn't know his budget, and how big bag he is going to
carry for the presents. Actually, Goostavo doesn't know anything at all,
right now.
When Goostavo finds out all of those three things, he will have to go and
buy the presents. He must buy equal amount of presents for each person,
otherwise someone may get offended! He also wants to spend as much
money from the bugest, as possible!
You will have to write a function, that will calculate the maximum amount
of money he is going to spend from his budget.
Here is what you will be given:
1) The amount of money Goostavo has for spending.
2) The volume of the bag, in which he will carry the presents.
3) The number of people he has to buy presents for.
4) The number of presents in the store.
5) Volume and price for each present.
The function will look like that:
public static float Contest7(float budget, float bagVolume, int people, int
Npresents, float [] presentVolume, float [] presentPrice);
Example input:
budget = 183.23
bagVolume = 64.11
people = 7
Npresents = 12
presentVolume[0] = 4.53
presentPrice[0] = 12.23
presentVolume[1] = 9.11
presentPrice[1] = 45.03
presentVolume[2] = 4.53
presentPrice[2] = 12.23
presentVolume[3] = 6.00
presentPrice[3] = 32.93
presentVolume[4] = 1.04
presentPrice[4] = 6.99
presentVolume[5] = 0.87
presentPrice[5] = 0.46
presentVolume[6] = 2.57
presentPrice[6] = 7.34
presentVolume[7] = 19.45
presentPrice[7] = 65.98
presentVolume[8] = 65.59
presentPrice[8] = 152.13
presentVolume[9] = 14.14
presentPrice[9] = 7.23
presentVolume[10] = 16.66
presentPrice[10] = 10.00
presentVolume[11] = 13.53
presentPrice[11] = 25.25
Note
1) There can be two or more presents with equal price and volume!
2) The amount of presents in the store will always be greater to the
amount of people Goostavo has to buy presents for.
3) Remember: Goostavo can buy more than one present for each person,
but the amount of presents he gives to each person must be equal! i.e.
everyone gets 1 present, or everyone gets 2 presents, and so on...
4) Remember: Goostavo need to spend AS MUCH money as possible, but
not go over the budget!

M
AnswerRe: Goostavo Problem solution Pin
Steve Hansen20-Mar-06 4:33
Steve Hansen20-Mar-06 4:33 
GeneralRe: Goostavo Problem solution Pin
Dan Neely20-Mar-06 5:40
Dan Neely20-Mar-06 5:40 
AnswerRe: Goostavo Problem solution Pin
Wjousts20-Mar-06 5:18
Wjousts20-Mar-06 5:18 
AnswerRe: Goostavo Problem solution Pin
J4amieC20-Mar-06 22:01
J4amieC20-Mar-06 22:01 
GeneralRe: Goostavo Problem solution Pin
Dan Neely21-Mar-06 1:56
Dan Neely21-Mar-06 1:56 
QuestionSource Code for stock chart Pin
Gilad Kapelushnik20-Mar-06 3:02
Gilad Kapelushnik20-Mar-06 3:02 
AnswerRe: Source Code for stock chart Pin
akki_00719-Mar-10 19:49
akki_00719-Mar-10 19:49 
Questionpassing multiple filenames from explorer to .net app Pin
..Hubert..20-Mar-06 2:10
..Hubert..20-Mar-06 2:10 
QuestionPlot Graph from Data in Excel Spreadsheet Pin
thebatch20-Mar-06 2:02
thebatch20-Mar-06 2:02 
AnswerRe: Plot Graph from Data in Excel Spreadsheet Pin
Ed.Poore20-Mar-06 5:50
Ed.Poore20-Mar-06 5:50 
QuestionMy user control (setting properties with my Properties window) Pin
conrado720-Mar-06 1:58
conrado720-Mar-06 1:58 
AnswerRe: My user control (setting properties with my Properties window) Pin
darkelv20-Mar-06 5:23
darkelv20-Mar-06 5:23 
QuestionHow to underline/highlight particular text in a RichTextBox Pin
mwenda20-Mar-06 1:46
mwenda20-Mar-06 1:46 
AnswerRe: How to underline/highlight particular text in a RichTextBox Pin
Baeltazor21-Feb-10 21:06
Baeltazor21-Feb-10 21:06 
QuestionNeed licensing feature for C# .NET windows application Pin
geek-age20-Mar-06 1:41
geek-age20-Mar-06 1:41 
AnswerRe: Need licensing feature for C# .NET windows application Pin
Dominik Reichl20-Mar-06 2:56
Dominik Reichl20-Mar-06 2:56 
GeneralRe: Need licensing feature for C# .NET windows application Pin
geek-age20-Mar-06 17:02
geek-age20-Mar-06 17:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.