Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Nov. 10, 2005 18:20:24

Avik C.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

I have a problem help me


Hello,
I'm avik.I have been facing a problem in a
typical Java program.The problem is...

Write a program in Java(Application not Applet)
that'll print the following:
*
***
*****
*******
I have done this but not more
class star
{
public static void main(String args)
{
for(int i=0;i<=10;i++) {
for(int j=0;j<=i;j++)
{
System.out.print("*");
}
System.out.println();
}
}
}
please help me.



__________________________________________________________
Enjoy this Diwali with Y! India Click herehttp://in.promos.yahoo.com/fabmall/index.html--
To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact

Offline

#2 Nov. 10, 2005 18:55:09

Vardan G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

I have a problem help me


On Thursday 10 November 2005 09:53 pm, Avik Chatterjee wrote:
> *******
public class Starts {
public static void main(String args) {
printStarts(7);
}

public static void printStarts(int count) {
int startsCount = 1;
int spaceCount = count/2;

while(startsCount <= count) {
for(int i = 0; i < spaceCount; i++)
System.out.print(" ");
for(int p = 1; p <= startsCount; p++)
System.out.print("*");
System.out.println();
startsCount += 2;
spaceCount--;
}
}
}


--
To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact

Offline

#3 Nov. 12, 2005 13:19:55

Luca M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

I have a problem help me


Alle 19:50, giovedì 10 novembre 2005, Vardan Gevorgyan ha scritto:
> On Thursday 10 November 2005 09:53 pm, Avik Chatterjee wrote:
> > *******
>
> public class Starts {
> public static void main(String args) {
> printStarts(7);
> }
>
> public static void printStarts(int count) {
> int startsCount = 1;
> int spaceCount = count/2;
//!!!! if count < 2 ????
if(count < 2)
count = 2;
// or exit();
>
> while(startsCount <= count) {
> for(int i = 0; i < spaceCount; i++)
> System.out.print(" ");
> for(int p = 1; p <= startsCount; p++)
> System.out.print("*");
> System.out.println();
> startsCount += 2;
> spaceCount--;
> }
> }
> }

Offline

#4 Nov. 12, 2005 14:17:16

Luca M.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

I have a problem help me


Hello !!
By to Italy.
Luca Mannocci


Alle 18:53, giovedì 10 novembre 2005, Avik Chatterjee ha scritto:
> Hello,
> I'm avik.I have been facing a problem in a
> typical Java program.The problem is...
>.....
that'll print the following:
*
***
*****
*******
*********
***********
> I have done this but not more
class star
{
public static void main(String args)
{


int b = 10;
int d = b/2;

for(int i=0;i<=d;i++) {
int ma=d-i;
int mb=d+i;
for(int j=0;j<=b;j++)
{
if( j >= ma && j <= mb)
System.out.print("*");
else
System.out.print(" ");

}//End 2^ loop
System.out.println();

}//End 1^ loop

}
> please help me.
>
>
>
> __________________________________________________________
> Enjoy this Diwali with Y! India Click here
>http://in.promos.yahoo.com/fabmall/index.html

Offline

#5 Nov. 12, 2005 14:26:02

Charles F.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

I have a problem help me


Is it just me, or is this entire thread a bit off topic for this list?

Charles

-----Original Message-----
> From: Luca Mannocci <>
> Subject: Re: I have a problem help me
> Date: Sat, 12 Nov 2005 14:56:34 +0100
> To: debian-j***@*ists.debian.org
> Old-Return-Path: <>
>
> Hello !!
> By to Italy.
> Luca Mannocci
>
>
> Alle 18:53, giovedì 10 novembre 2005, Avik Chatterjee ha scritto:
> > Hello,
> > I'm avik.I have been facing a problem in a
> > typical Java program.The problem is...
> >.....
> that'll print the following:
> *
> ***
> *****
> *******
> *********
> ***********
> > I have done this but not more
> class star
> {
> public static void main(String args)
> {
>
>
> int b = 10;
> int d = b/2;
>
> for(int i=0;i<=d;i++) {
> int ma=d-i;
> int mb=d+i;
> for(int j=0;j<=b;j++)
> {
> if( j >= ma && j <= mb)
> System.out.print("*");
> else
> System.out.print(" ");
>
> }//End 2^ loop
> System.out.println();
>
> }//End 1^ loop
>
> }
> > please help me.
> >
> >
> >
> > __________________________________________________________
> > Enjoy this Diwali with Y! India Click here
> >http://in.promos.yahoo.com/fabmall/index.html>

--
That "pink toothbrush"
Is a curse
But that pink razor's
A darn sight worse
Use
Burma-Shavehttp://burma-shave.org/jingles/1934/that_pink_toothbrushsignature.ascDescription:Digital signature

Attachments:
attachment signature.asc (189 bytes)

Offline

#6 Nov. 12, 2005 14:53:24

David N.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

I have a problem help me


Charles Fry wrote:
> Is it just me, or is this entire thread a bit off topic for this list?

Yeah, it brings to mind answers like this:http://www.uwasa.fi/~ts/http/homework.html--
David N. Welton
-http://www.dedasys.com/davidw/Linux, Open Source Consulting
-http://www.dedasys.com/--
To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact

Offline

#7 Nov. 13, 2005 17:59:52

François-Denis G.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

I have a problem help me


On 10 November 2005 12:53, Avik Chatterjee wrote:

One should never answer a question like this on a mailing list. The first
reason should because it is off-topic, this has nothing to do with Debian.
The other reason is that its very likely an homework question and homeworks
should by done personally.

The person asking that might get into trouble for refering to an external
resource, and if not, could very well fail in other tests and exams because
he does not fully comprehend the subject.

Sorry if I sound angry, but it's a very sensitive subject for me.

> Hello,
> I'm avik.I have been facing a problem in a
> typical Java program.The problem is...
>
> Write a program in Java(Application not Applet)
> that'll print the following:
> *
> ***
> *****
> *******
> I have done this but not more
> class star
> {
> public static void main(String args)
> {
> for(int i=0;i<=10;i++) {
> for(int j=0;j<=i;j++)
> {
> System.out.print("*");
> }
> System.out.println();
> }
> }
> }
> please help me.
>
>
>
> __________________________________________________________
> Enjoy this Diwali with Y! India Click here
>http://in.promos.yahoo.com/fabmall/index.htmlpgpQBfRRd4jCV.pgpDescription:PGP signature

Attachments:
attachment pgpQBfRRd4jCV.pgp (189 bytes)

Offline

#8 Nov. 15, 2005 02:22:38

Dalibor T.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

I have a problem help me


David N. Welton <davidw <at> dedasys.com> writes:

>
> Charles Fry wrote:
> > Is it just me, or is this entire thread a bit off topic for this list?
>
> Yeah, it brings to mind answers like this:
>
>http://www.uwasa.fi/~ts/http/homework.html>http://home.att.net/~jackklein/ctips01.html#homework... I love the potential
standard reply for such situations:

"If I did your homework for you, then you might pass your class without learning
how to write a program like this. Then you might graduate and get your degree
without learning how to write a program like this. You might become a
professional programmer without knowing how to write a program like this.
Someday you might work on a project with me without knowing how to write a
program like this. Then I would have to do you serious bodily harm.

Please post your instructor's email address in case I have any questions about
your assignment. In fact, I have a great idea. I could just email your
assignment directly to your instructor and then you wouldn't even have to go to
class either!"

cheers,
dalibor topic




--
To UNSUBSCRIBE, email to
with a subject of "unsubscribe". Trouble? Contact

Offline

Board footer

Moderator control

Enjoy the 18th of November
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support