Please Help me Out...

J

JAVA PROGRAMMER

here's the program...
please give me the program...its very very urgent..
and please do explain me what does the program wanna say and what does
it want from a programmer...


Suppose we have a set of balls and a large cuboid box, with a
rectangle as its base. The box has a fixed size at the base, but we
can choose its height. We would like to place all the balls within the
box, and at the same time try to minimize its height.
Input

First, 2 integers, 10 a,b 100 - the dimensions of the rectangular base
of the box. Then, an integer 1 n 10000, representing the number of
balls. The following n values 1 ri 5 are the radii of the respective
balls.
Output

You should write to output n triples of floating-point numbers, the
ith triple being the x,y, and z coordinates of the center of the ith
ball.
If we want to be precise, the coordinates of the points written to
output must fulfill the following constraints for the i-th point: xi-
ri 0, yi-ri 0, zi-ri 0, xi+ri a, yi+ri b. Moreover, for each i j, (xi
- xj)2 + (yi - yj)2 + (zi - zj)2 (ri + rj)2 (no two balls are allowed
to overlap).
Scoring

The goal is to minimize the height h of the box, where h = maxi (zi
+ri). For each data set, your program will be scored by the proportion
of the box volume actually used by the balls:
score = 4/3* *(r13+..+rn3)/(a*b*h).
The program is run independently for a number of data sets, and the
displayed score is the mean of scores obtained for individual data
sets.
Example

Input:
5 5
2
1.0
2.0

Output:
4.0 4.0 3.0
2.0 2.0 2.0

Score:
37.6991118/100.0 = 0.376991118


thanx in advance !!!

Regards,
Java Programmer.
 
S

scott

here's the program...
please give me the program...its very very urgent..
and please do explain me what does the program wanna say and what does
it want from a programmer...

Suppose we have a set of balls and a large cuboid box, with a
rectangle as its base. The box has a fixed size at the base, but we
can choose its height. We would like to place all the balls within the
box, and at the same time try to minimize its height.
Input

First, 2 integers, 10 a,b 100 - the dimensions of the rectangular base
of the box. Then, an integer 1 n 10000, representing the number of
balls. The following n values 1 ri 5 are the radii of the respective
balls.
Output

You should write to output n triples of floating-point numbers, the
ith triple being the x,y, and z coordinates of the center of the ith
ball.
If we want to be precise, the coordinates of the points written to
output must fulfill the following constraints for the i-th point: xi-
ri 0, yi-ri 0, zi-ri 0, xi+ri a, yi+ri b. Moreover, for each i j, (xi
- xj)2 + (yi - yj)2 + (zi - zj)2 (ri + rj)2 (no two balls are allowed
to overlap).
Scoring

The goal is to minimize the height h of the box, where h = maxi (zi
+ri). For each data set, your program will be scored by the proportion
of the box volume actually used by the balls:
score = 4/3* *(r13+..+rn3)/(a*b*h).
The program is run independently for a number of data sets, and the
displayed score is the mean of scores obtained for individual data
sets.
Example

Input:
5 5
2
1.0
2.0

Output:
4.0 4.0 3.0
2.0 2.0 2.0

Score:
37.6991118/100.0 = 0.376991118

thanx in advance !!!

Regards,
Java Programmer.

Suppose we have a homework problem, attempt the problem yourself and
post specific questions with your work if you get stuck.
 
J

Joshua Cranmer

JAVA said:
here's the program...
please give me the program...its very very urgent..
and please do explain me what does the program wanna say and what does
it want from a programmer...

Sure, here's the program:

public class HomeworkProblem {
public static void main(String... args) {
System.out.println("I have a confession to make...");
System.out.println("Instead of doing the program normally like "+
"most people in the class, I was unable or unwilling to do the "+
"assignment, so I instead looked for someone else to solve the "+
"problem for me, constituting academic dishonesty.");
System.out.println("I will therefore willingly accept the "+
"punishment for said misconduct, be it a zero on the assignment,"+
" failure in the course, expulsion from the school, or some "+
"combination thereof.");
}
}
 
R

Roedy Green

Suppose we have a set of balls and a large cuboid box, with a
rectangle as its base. The box has a fixed size at the base, but we
can choose its height. We would like to place all the balls within the
box, and at the same time try to minimize its height.
Input

See http://mindprod.com/jgloss/homework.html

Doing your homework for you would not help you out. It would cheat you
out of an expensive education.

Many of us would love to help you, but not in a way that would cripple
you.
 
R

Roedy Green

System.out.println("I will therefore willingly accept the "+
"punishment for said misconduct, be it a zero on the assignment,"+
" failure in the course, expulsion from the school, or some "+
"combination thereof.");

There is a new grade in Canada, below F, F-D for failure with academic
dishonesty.

It is so odd people spend tens of thousands of dollars on an
education, then do everything they can to avoid learning anything.

It is sort of like spending $1000 on first row concert tickets then
hiding out in the john for the whole show.

It would have been much more efficient to spend the money directly on
travel, drugs, booze...

The overwhelming pressure of assignments and study can seem unbearable
at the time, but later, it looks like astounding luxury, a chance to
learn about thousands of things in an environment where you have the
brightest people surrounding you with no other demands on you other
than sexual frustration.
 
J

Joshua Cranmer

Roedy said:
There is a new grade in Canada, below F, F-D for failure with academic
dishonesty.

In the United States, for university-level at least, it seems to me that
academic dishonesty is always at least an automatic failure. In more
than a few universities I've seen, it's pretty much an expulsion if you
are caught and exhaust your appeals. Then again, these are also
universities in the South, which tends to culturally view itself as more
honorable than other parts of the US.

I don't know what penalties are like in India, though, which seems to be
where the poster is from.
It is so odd people spend tens of thousands of dollars on an
education, then do everything they can to avoid learning anything.

In the educational environment I grew up with (I went to a selective
high school), academic dishonesty probably wasn't a case of avoiding
learning. It was more likely a factor of people needing (or at least,
thinking that they need) to get phenomenal grades for various reasons,
be it societal pressure or perceived pressure or personal gain.

Consider, for example, that one of the more high-profile incidents was a
cheating ring on an examination (the National French Examination) that
was totally optional, did not count for a grade, and where the only
prize was a T-shirt and a medal. Maybe a little pin as well, I don't
remember. The only explanations for cheating I can think up would
involve either be an uncontrollable need to cheat for good grades or the
ability to add another line to a college application.

I would say more, but to do so would stretch the lines of political
correctness and my knowledge of the facts at hand.
 
E

Eric Sosman

JAVA said:
here's the program...
please give me the program...its very very urgent..
and please do explain me what does the program wanna say and what does
it want from a programmer...
[... homework ...]

The nice thing about homework is that it almost always deals
with problems that are well-studied and already solved. Sure
enough, a quick Google search turns up

http://www.dourish.com/goodies/see-figure-1.html

.... which considers a problem just a little bit different from
the one you (your teacher, that is) posed, but whose advice is
exactly what you need.

By the way: Be sure to let us know when you've earned the
right to your mail alias. At the moment, you're committing
identity theft.
 
Q

Qu0ll

[...]
By the way: Be sure to let us know when you've earned the
right to your mail alias. At the moment, you're committing
identity theft.

LOL!

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
(e-mail address removed)
[Replace the "SixFour" with numbers to email me]
 
K

Karl Uppiano

When I was working on my masters degree I noticed that many of the Indian
students seemed to think that cheating really wasn't unethical. I don't
mean to slam the entire Indian population, but at least at the school I
attended the students did not seem to view cheating in the same light
that I did. I don't know if this is typical of education in India.

Unless East Indians as a culture are so smart that they learn from seeing
the problem solved instead of solving it themselves, I would think that if
this were typical of education in India, then they would be turning out some
very bad programmers.
 
Q

Qu0ll

Karl Uppiano said:
Unless East Indians as a culture are so smart that they learn from seeing
the problem solved instead of solving it themselves, I would think that if
this were typical of education in India, then they would be turning out
some very bad programmers.

I don't know if the problem is related to Indian's feeling that cheating is
an acceptable way to succeed in a course or not, it may have more to do with
the way they perceive Usenet. At risk of pigeon-holing an entire race of
people unfairly I can say that I have seen some Indian's almost demanding
things on Usenet and expecting immediate answers. How often have you seen
posts like:

Plz help, need to solves sorting algorthm.
Pls send the codes, hurry.

Perhaps they think newsgroups are a Help Desk styled service that must meet
their every need promptly and don't realise that it's just a bunch of like
programmers who may or may not help when appropriate if they have the time
and who don't get paid to do so. Maybe this is part of the culture, maybe
it is taught, I don't know.

[ If I have offended any genuine, honest, polite, hard-working Indians I am
sorry - I am not trying to offend - and I am sure the vast majority of you
fall into this category. Every society is let down by a few individuals and
this is probably what's happening here too. ]

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
(e-mail address removed)
[Replace the "SixFour" with numbers to email me]
 
A

Arved Sandstrom

Qu0ll said:
I don't know if the problem is related to Indian's feeling that cheating
is an acceptable way to succeed in a course or not, it may have more to
do with the way they perceive Usenet. At risk of pigeon-holing an
entire race of people unfairly I can say that I have seen some Indian's
almost demanding things on Usenet and expecting immediate answers. How
often have you seen posts like:

Plz help, need to solves sorting algorthm.
Pls send the codes, hurry.

Incontrovertible. Not just Usenet, but vendor technical forums and
peoples' blogs (that have comments). It does get annoying after a
while...somebody writes a nice blog article on some arcane factoid
related to JSF, say, and soon enough in the comments you'll see

plz send example web app
Perhaps they think newsgroups are a Help Desk styled service that must
meet their every need promptly and don't realise that it's just a bunch
of like programmers who may or may not help when appropriate if they
have the time and who don't get paid to do so. Maybe this is part of
the culture, maybe it is taught, I don't know.

I suspect it's not endemic to the culture but is rather a byproduct of
immense numbers of Asian kids looking for the way up and out, and
probably many of them are not all that interested in coding per se.
Whereas in the West software development is actually a relatively
unpopular discipline (although we coders may not recognize that), and a
homegrown developer probably at least likes his chosen discipline.

Immense numbers and different motivations means that if even 5 or 10
percent of them are completely uninterested in actually learning about
programming, and if a percentage of _them_ discover Usenet, that's why
we see so many of these peremptory requests.
[ If I have offended any genuine, honest, polite, hard-working Indians I
am sorry - I am not trying to offend - and I am sure the vast majority
of you fall into this category. Every society is let down by a few
individuals and this is probably what's happening here too. ]

I'm sure all of us in the industry have had the opportunity to work
alongside Indians. In my case quite a few, both in Canada and the
States. In fact right now I work with two, and one is actually a
colleague in the same small company. All of them have been Hindus of
fairly high caste, and they absolutely do not behave the same way as
these online wastoids. And many of us in North America encounter Hindus
who work at other things (doctors, engineers etc) and again, they are
just as hardworking as the next person.

So I do not think this is a cultural thing, I think it's economic. Bad
academic habits and tenuous ethics are just as much of a problem amongst
our youngsters, but currently they're not as focused on serious
programming and the numbers are much smaller. So that's why we usually
see Daljit from Mumbai asking for the answer to a homework problem, and
not Doug from Des Moines.

AHS
 
M

Martin Gregorie

I don't know what penalties are like in India, though, which seems to be
where the poster is from.
Back in the late 70s it was quite common to see people signing themselves
like this:

Ahmed Patel, BA Calcutta (failed)

in India, presumably on the grounds that having attended university and
not got a degree was better than not having gone to university.
 
J

Joshua Cranmer

I read somewhere that a fair number of companies that outsourced
programming work saw the results and regretted it. I would therefore not
be surprised if some Indian universities were turning out people whose
competence at programming leaves something to be desired.
I don't know if the problem is related to Indian's feeling that cheating
is an acceptable way to succeed in a course or not, it may have more to
do with the way they perceive Usenet.

At the very least, the East Asian cultures do produce cut-throat
academic environments which, combined with societal pressures, could
explain a greater propensity towards cheating.

Or it could be that Indians cheat no more than the rest of us, so only
the absolute size of the Indian programmer population gives such an
impression.
Perhaps they think newsgroups are a Help Desk styled service...

On a second reading, that is actually a rather... fitting statement.
[ If I have offended any genuine, honest, polite, hard-working Indians I
am sorry - I am not trying to offend - and I am sure the vast majority
of you fall into this category. Every society is let down by a few
individuals and this is probably what's happening here too. ]

In lieu of being able to come into contact with a significant number of
people of different ethnicities and cultures, we must base our opinions
of other cultures on those members with whom we have come in contact. So
if all the Elbonians you know are greedy, arrogant thugs, you would
probably assume that much of Elbonia is made up of greedy, arrogant
thugs, at least subconsciously.
 
A

Arne Vajhøj

Karl said:
Unless East Indians as a culture are so smart that they learn from
seeing the problem solved instead of solving it themselves, I would
think that if this were typical of education in India, then they would
be turning out some very bad programmers.


India has hundreds of thousands of software engineers (maybe millions).

Skills are most likely following a normal distribution (bell curve), so
they must have many good, awful lot of medium and many bad programmers.

Arne
 
A

Arne Vajhøj

Joshua said:
I read somewhere that a fair number of companies that outsourced
programming work saw the results and regretted it. I would therefore not
be surprised if some Indian universities were turning out people whose
competence at programming leaves something to be desired.

Outsourcing can be difficult even with good programmers. GIGO principle.

Arne
 
A

Arne Vajhøj

Arved said:
I suspect it's not endemic to the culture but is rather a byproduct of
immense numbers of Asian kids looking for the way up and out, and
probably many of them are not all that interested in coding per se.
Whereas in the West software development is actually a relatively
unpopular discipline (although we coders may not recognize that), and a
homegrown developer probably at least likes his chosen discipline.

Immense numbers and different motivations means that if even 5 or 10
percent of them are completely uninterested in actually learning about
programming, and if a percentage of _them_ discover Usenet, that's why
we see so many of these peremptory requests.

Sounds very plausible.

Those with an interest for IT will (at average) be better at IT than
those without such an interest.

That could give countries with good IT job opportunities but few
other academic job opportunities a fatter "bad" tail (bell curve).
[ If I have offended any genuine, honest, polite, hard-working Indians
I am sorry - I am not trying to offend - and I am sure the vast
majority of you fall into this category. Every society is let down by
a few individuals and this is probably what's happening here too. ]

I'm sure all of us in the industry have had the opportunity to work
alongside Indians. In my case quite a few, both in Canada and the
States. In fact right now I work with two, and one is actually a
colleague in the same small company. All of them have been Hindus of
fairly high caste, and they absolutely do not behave the same way as
these online wastoids. And many of us in North America encounter Hindus
who work at other things (doctors, engineers etc) and again, they are
just as hardworking as the next person.

And I also suspect that all or at least most of us have seen
totally clueless westerners in IT as well.

Arne
 
K

Karl Uppiano

In lieu of being able to come into contact with a significant number of
people of different ethnicities and cultures, we must base our opinions of
other cultures on those members with whom we have come in contact. So if
all the Elbonians you know are greedy, arrogant thugs, you would probably
assume that much of Elbonia is made up of greedy, arrogant thugs, at least
subconsciously.

A certain measure of tempered prejudice is not entirely unjustified, as long
as you're willing to update your prejudices when presented with new
information.
 
K

Karl Uppiano

Arne Vajhøj said:
Outsourcing can be difficult even with good programmers. GIGO principle.

Except for rare exceptions, I think you absolutely must have a very well
defined, self-contained or unit-testable specification, or your project is
doomed by outsourcing.
 
K

Karl Uppiano

Arne Vajhøj said:
India has hundreds of thousands of software engineers (maybe millions).

Skills are most likely following a normal distribution (bell curve), so
they must have many good, awful lot of medium and many bad programmers.

That is so. However, if they were all trained at schools as I described
above, the bell curve itself would be shifted far to the "bad" side. My
statement was partly meant to suggest that perhaps their schools are not
like that.
 
B

Bill McCleary

Karl said:
A certain measure of tempered prejudice is not entirely unjustified, as
long as you're willing to update your prejudices when presented with new
information.

Even prejudice against a whole race of people?

Okay. I guess you've earned this then. Wear it with pride:

/\
/ /
/ /
/ / /\
\ \ / \
\ \ / /\ \
\ \/ / \ \
/\ \ / \ \
\ \ / \ \/
\ \ / /\ \
\ \/ / \ \
\ / \ \
\/ / /
/ /
/ /
/ /
\/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,979
Messages
2,570,185
Members
46,722
Latest member
NelsonHeil

Latest Threads

Top