Re: Program help

From: David Hilsee (davidhilseenews_at_yahoo.com)
Date: 09/15/04


Date: Wed, 15 Sep 2004 00:02:54 -0400


"Josh" <tool540@yahoo.com> wrote in message
news:3b2ebc2c.0409141950.20d807d4@posting.google.com...
> Howdy
> i am newb somewhat to programing and i was just for fun trying to
> compile a program that asks the user for an odd int less than 22 and
> then returns this
> *****************
> ******* *********
> ****** ********
> ***** *******
> etc. the first line reps. the number enterd by user
> but i am having trouble i can get the first line but am having trouble
> making the white space in the middle i am using a nested loop. Should
> i use arrays? Any help would help thanks

This sounds like homework. In any case, you should try to describe the
problem a little better.

You ask the user for an odd int less than 22. OK, but what are you trying
to do with it? I don't see much correlation between the number of stars or
the number of spaces and the number "22". I'm guessing that you meant to
write 22 stars on the first line but instead wrote 17?

I'm assuming that your example output's width was intended to be 22, so your
program somehow displays an "asterisk" grid with width 22 and an empty
diamond in the middle. Is that right? In that case, I recommend that you
post your attempt at solving the problem so others do not feel like they are
giving you the answer to your homework. Currently, it sounds like a problem
that could be solved with two (relatively simple) for loops.

-- 
David Hilsee


Relevant Pages

  • Re: time complexity.. again there was some mistake.
    ... Those are the nested loop. ... I appreciate your generous help. ... don't say to me 'do you own homework'. ...
    (sci.math)
  • time complexity
    ... Those are the nested loop. ... I wanna know where it's right or not. ... I appreciate your generous help. ... don't say to me 'do you own homework'. ...
    (comp.theory)
  • time complexity.. again there was some mistake.
    ... Those are the nested loop. ... I wanna know where it's right or not. ... I appreciate your generous help. ... don't say to me 'do you own homework'. ...
    (sci.math)
  • time complexity
    ... Those are the nested loop. ... I wanna know where it's right or not. ... I appreciate your generous help. ... don't say to me 'do you own homework'. ...
    (comp.programming)
  • Re: Unlikely, one-day-off comic synchronicity
    ... The "dog/cat/giant blob ate my ... homework" dodge is only useful if you haven't done your homework and need ... where you see stars: wypbs.**1 at gmail.com. ...
    (rec.arts.comics.strips)