Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Help with an assignment (http://www.velocityreviews.com/forums/t390936-help-with-an-assignment.html)

James Bryan Chua 02-18-2007 06:11 AM

Help with an assignment
 
Alright I'm having a bit of trouble getting started for this
assignment in my Java class. I have to create a class that prompts for
how many rows are in a triangle and print the output with an
equilateral triangle where the top row is centered and comes down as
if it was center justified-- and also a triangle as if it were right
justified. Thanks in advance for your help.


Patricia Shanahan 02-18-2007 07:10 AM

Re: Help with an assignment
 
James Bryan Chua wrote:
> Alright I'm having a bit of trouble getting started for this
> assignment in my Java class. I have to create a class that prompts for
> how many rows are in a triangle and print the output with an
> equilateral triangle where the top row is centered and comes down as
> if it was center justified-- and also a triangle as if it were right
> justified. Thanks in advance for your help.
>


I have some general advice on getting started on assignments at
http://home.earthlink.net/~patricia_.../beginner.html

For tasks like the triangle drawing, it can be helpful to try to do the
task yourself, and see what you have to do.

Patricia

Lothar Kimmeringer 02-18-2007 10:54 AM

Re: Help with an assignment
 
James Bryan Chua wrote:

> Thanks in advance for your help.


You haven't specified, what your problem is. That way nobody
can help you in another way than wishing you luck.


Regards, Lothar
--
Lothar Kimmeringer E-Mail: spamfang@kimmeringer.de
PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)

Always remember: The answer is forty-two, there can only be wrong
questions!

Alex Hunsley 02-18-2007 11:47 AM

Re: Help with an assignment
 
James Bryan Chua wrote:
> Alright I'm having a bit of trouble getting started for this
> assignment in my Java class.

[snip description]

Shame that! Did you actually have a question for us?

Did you try the exercise? How far did you get? What happened?

Patricia Shanahan 02-18-2007 03:32 PM

Re: Help with an assignment
 
Alex Hunsley wrote:
> James Bryan Chua wrote:
>> Alright I'm having a bit of trouble getting started for this
>> assignment in my Java class.

> [snip description]
>
> Shame that! Did you actually have a question for us?
>
> Did you try the exercise? How far did you get? What happened?


The quoted sentence says "I'm having a bit of trouble getting started"
so I assume he did not get very far, and needs advice on how to get
started, which I sent in my first response.

Patricia

John 02-18-2007 03:47 PM

Re: Help with an assignment
 
Patricia Shanahan wrote:
> Alex Hunsley wrote:
>
>> James Bryan Chua wrote:
>>
>>> Alright I'm having a bit of trouble getting started for this
>>> assignment in my Java class.

>>
>> [snip description]
>>
>> Shame that! Did you actually have a question for us?
>>
>> Did you try the exercise? How far did you get? What happened?

>
>
> The quoted sentence says "I'm having a bit of trouble getting started"
> so I assume he did not get very far, and needs advice on how to get
> started, which I sent in my first response.
>
> Patricia

OP - We need more information...

For example the number must be 3 or greater. Are you doing any kind of
error checking?

What are you using for a row element>? "*" or "x" or somthing?
Do you have an algorithm for determining how many "*"s you need? I
think you will need something to help you figure out how many you need.

Andrew Thompson 02-18-2007 05:00 PM

Re: Help with an assignment
 
On Feb 19, 2:47 am, John <printdude1...@gmail.com> wrote:
...
> OP - We need more information...


No we don't. Or rather, the best help
the OP can get at the moment is the
advice (and link) that Patricia has
already given.

The OP will not get very far with
programming, if they come to rely
on people who spoon-feed the answers.

Andrew T.


Patricia Shanahan 02-18-2007 05:04 PM

Re: Help with an assignment
 
John wrote:
> Patricia Shanahan wrote:
>> Alex Hunsley wrote:
>>
>>> James Bryan Chua wrote:
>>>
>>>> Alright I'm having a bit of trouble getting started for this
>>>> assignment in my Java class.
>>>
>>> [snip description]
>>>
>>> Shame that! Did you actually have a question for us?
>>>
>>> Did you try the exercise? How far did you get? What happened?

>>
>>
>> The quoted sentence says "I'm having a bit of trouble getting started"
>> so I assume he did not get very far, and needs advice on how to get
>> started, which I sent in my first response.
>>
>> Patricia

> OP - We need more information...
>


I don't see that we do. Remember the objective is to help the OP get
started, not to do the assignment for him.

Patricia

James Bryan Chua 02-18-2007 05:48 PM

Re: Help with an assignment
 
On Feb 18, 12:04 pm, Patricia Shanahan <p...@acm.org> wrote:
> John wrote:
> > Patricia Shanahan wrote:
> >> Alex Hunsley wrote:

>
> >>> James Bryan Chua wrote:

>
> >>>> Alright I'm having a bit of trouble getting started for this
> >>>> assignment in my Java class.

>
> >>> [snip description]

>
> >>> Shame that! Did you actually have a question for us?

>
> >>> Did you try the exercise? How far did you get? What happened?

>
> >> The quoted sentence says "I'm having a bit of trouble getting started"
> >> so I assume he did not get very far, and needs advice on how to get
> >> started, which I sent in my first response.

>
> >> Patricia

> > OP - We need more information...

>
> I don't see that we do. Remember the objective is to help the OP get
> started, not to do the assignment for him.
>
> Patricia


In no way, was I trying to get anyone to give me the answer.. I really
want to learn to program well and was just stuck on this problem..
I've figured out how to make a left justified triangle by prompting
for input n and using a for loop where i < n to print out "[]" *(i+1).
Now, I'm just unsure how to do it where the triangle is centered and
right justified. Any advice? Thank you.


John 02-18-2007 06:10 PM

Re: Help with an assignment
 
Patricia Shanahan wrote:
> John wrote:
>
>> Patricia Shanahan wrote:
>>
>>> Alex Hunsley wrote:
>>>
>>>> James Bryan Chua wrote:
>>>>
>>>>> Alright I'm having a bit of trouble getting started for this
>>>>> assignment in my Java class.
>>>>
>>>>
>>>> [snip description]
>>>>
>>>> Shame that! Did you actually have a question for us?
>>>>
>>>> Did you try the exercise? How far did you get? What happened?
>>>
>>>
>>>
>>> The quoted sentence says "I'm having a bit of trouble getting started"
>>> so I assume he did not get very far, and needs advice on how to get
>>> started, which I sent in my first response.
>>>
>>> Patricia

>>
>> OP - We need more information...
>>

>
> I don't see that we do. Remember the objective is to help the OP get
> started, not to do the assignment for him.
>
> Patricia

Which is exactly what *I* was trying to do. And since there's no way I
could possibly code a solution to the problem without asking for /
looking for help, I tried to supply a starting point.


All times are GMT. The time now is 12:37 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.