What I can do?
Im a 14-yers old programmer whos leraning Java. In my Lerningbook there is a question I cant answer: how i can write a program which give the first 100 "Quadratzahlen" (Im a stupid german, i can speak english very well but i dont now some words) on the flat out. after 10 "Quadratzahlen" the user must type enter to continue the program? How i can do this? Please help the stupid german and his bad english know-how!
> Im a 14-yers old programmer whos leraning Java. In my
> Lerningbook there is a question I cant answer: how i
> can write a program which give the first 100
> "Quadratzahlen" (Im a stupid german, i can speak
> english very well but i dont now some words) on the
> flat out. after 10 "Quadratzahlen" the user must type
> enter to continue the program? How i can do this?
> Please help the stupid german and his bad english
> know-how!
"Square number." Do you know how to calculate those? A number multiplied by itself.
You need a for loop (since the task spells "counting"), and you also need to read from System.in to make the console output stop and wait for the user to hit enter.
Thanks a lot. From which country do you come from?
@OP. You are young, and I guess that you are trying to learn Java because you want to create something. Why are you trying to solve the boring exercises? Why not just do something fun? E.g. try to create a simple game, like guess the number? (And then just use the book to look up things)
Kaj
Okay, you need to know what a for loop is. So, read up on that. Your book should treat it a lot. Also, the easiest way to get the square (which is what "quadrat" means in english) of a number ("zahlen") in Java is just to multiply it by itself:
x * x
So just put it in a for loop from 0 to 99 (I'm assuming they mean for you to use 0 and the positive numbers, since there really are no first 100 squares) and print out the square of each number using System.out.println. Use an if statement to check if it's the 10th run through the for loop. If so, then you'll check for the user to push enter. If you're not sure how to do that, ask.
Also, if I mistranslated Quadratzahlen, then the code above may be wrong, but maybe you can verify that that's correct?
> Why not just do something fun? If he wants to do something fun, I'd recommend he get a completely different language. I find Python to be a lot more fun, for example.
> > Why not just do something fun? > > If he wants to do something fun, I'd recommend he get> a completely different language. I find Python to be> a lot more fun, for example.I find QBasic very funny. :)
> > Why not just do something fun? > > If he wants to do something fun, I'd recommend he get> a completely different language. I find Python to be> a lot more fun, for example.It all depends on what you think is fun :)
> France.I mean, that's where I come from.
> It all depends on what you think is fun :)I can think of a lot of things, but none being related to programming.
That sounds good. Maybe i can look what Phython is. Maybe i like this language. Thanks for this tip!
Really? I happen to think programming is highly entertaining :)... when I code my own projects that is.
Can you speak german? I can speak francxe a bit like Cest que cest? Cest une table or so...
Yes, thats the right escription for Quadratzahlen. But do you now what "Bruchgleichungen" in english is?:)
> Yes, thats the right escription for Quadratzahlen.> But do you now what "Bruchgleichungen" in english> is?:) http://www.google.com/translate_t Bruchgleichungen = Break equations.
I wrote my first Console-Program just fun. Its not perfect, but its good to use(I hope you understand what o mean!) Its a program which answer the user for his name/surname, username, passwort/retype passwort (and IF the retyped-Password is not correct, the program gives a "Fehlermeldung" out.)
and for the password who i set. And IF this Passwort is correct, the user ask for
transfer the dates. ELSE the Prgoram stop.
and whats "Java ist ein Programmiersprache, welche ich, Alexander Kluth aus Dsseldorf neben unter anderem Seitenbeschreibungssprache lerne" in english? (I knock you out!:)
> Can you speak german? I can speak francxe a bit like> Cest que cest? Cest une table or so...Cest pas un programmeur...
> and whats "Java ist ein Programmiersprache, welche
> ich, Alexander Kluth aus Dsseldorf neben unter
> anderem Seitenbeschreibungssprache lerne" in english?
> (I knock you out!:)
I am too lazy to refer to my books. It has been four years since I last looked at German.
Google translation:
Java is programming language, which I, Alexander Kluth from Duesseldorf apart from under other side specification language learn
> Can you speak german? I can speak francxe a bit like> Cest que cest? Cest une table or so...Ja, ich spreche ganz gut Deutsch. Strassburg ist nicht so weit weg von der Grenze, und meine Mutter ist Deutsche.
> > Can you speak german? I can speak francxe a bit> like> > Cest que cest? Cest une table or so...> Cest pas un programmeur...<looks at desk>oui, mais - ceci est une pipe.
tsitha at 2007-7-20 21:14:00 >

> oui, mais - ceci est une pipe.:D
I think I'll start revising German :)Why does the translation show "Mutter" as nut/mother? I thought that word was used for mother only.
> Why does the translation show "Mutter" as nut/mother?> I thought that word was used for mother only.Nope, it's correct. It has both meanings.
Nut as in "nuts and bolts" btw.
> > Why does the translation show "Mutter" as nut/mother?
> > I thought that word was used for mother only.
>
> Nope, it's correct. It has both meanings.
I've never seen Babelfish give two meanings before. I've seen it translate things strangely, especially idioms.
MLRona at 2007-7-20 21:14:00 >

> > > Why does the translation show "Mutter" as
> nut/mother?
> > > I thought that word was used for mother only.
> >
> > Nope, it's correct. It has both meanings.
>
> I've never seen Babelfish give two meanings before.
> I've seen it translate things strangely, especially
> y idioms.
They might be changing some code to make it generic. :D
> Nut as in "nuts and bolts" btw.Thanks. I really need to find my notes now.
> http://www.google.com/translate_t > Bruchgleichungen = Break equations.Nein um Gottes Willen! Eine Bruchgleichung ist eine Gleichung mit Bruchterme wie etwa,1/x + 1/(1-x) = 0
> > http://www.google.com/translate_t > > Bruchgleichungen = Break equations.> > Nein um Gottes Willen! Eine Bruchgleichung ist eine> Gleichung mit Bruchterme wie etwa,> > 1/x + 1/(1-x) = 0Mujhe maloom hai.
Ulrika, Du bist gut. Wie lange warst Du in Kiel?
> > > http://www.google.com/translate_t
> > > Bruchgleichungen = Break equations.
> >
> > Nein um Gottes Willen! Eine Bruchgleichung ist
> eine
> > Gleichung mit Bruchterme wie etwa,
> >
> > 1/x + 1/(1-x) = 0
>
> Mujhe maloom hai.
Mai Hindi nahi bohta
tsitha at 2007-7-20 21:14:05 >

> I think I'll start revising German :)
>
> Why does the translation show "Mutter" as nut/mother?
> I thought that word was used for mother only.
Ist meine Mutter eine Mutter, das ist die Frage? Bitte antworten Sie sofort. Ich mchte gerne wissen falls Sie mein Vater ist or eine Schraube. -:)
tsitha at 2007-7-20 21:14:05 >

> > > > http://www.google.com/translate_t
> > > > Bruchgleichungen = Break equations.
> > >
> > > Nein um Gottes Willen! Eine Bruchgleichung ist
> > eine
> > > Gleichung mit Bruchterme wie etwa,
> > >
> > > 1/x + 1/(1-x) = 0
> >
> > Mujhe maloom hai.
>
> Mai Hindi nahi bohta
Par likhta to hai. [bolta not bohta :) ]
> Ist meine Mutter eine Mutter, das ist die Frage?> Bitte antworten Sie sofort. Ich mchte gerne wissen> falls Sie mein Vater ist or eine Schraube. -:)Schweinhund. Ya.
> > > > > http://www.google.com/translate_t
> > > > > Bruchgleichungen = Break equations.
> > > >
> > > > Nein um Gottes Willen! Eine Bruchgleichung ist
> > > eine
> > > > Gleichung mit Bruchterme wie etwa,
> > > >
> > > > 1/x + 1/(1-x) = 0
> > >
> > > Mujhe maloom hai.
> >
> > Mai Hindi nahi bohta
>
> Par likhta to hai. [bolta not bohta :) ]
See, I told you.
tsitha at 2007-7-20 21:14:05 >

> > > > > > http://www.google.com/translate_t
> > > > > > Bruchgleichungen = Break equations.
> > > > >
> > > > > Nein um Gottes Willen! Eine Bruchgleichung
> ist
> > > > eine
> > > > > Gleichung mit Bruchterme wie etwa,
> > > > >
> > > > > 1/x + 1/(1-x) = 0
> > > >
> > > > Mujhe maloom hai.
> > >
> > > Mai Hindi nahi bohta
> >
> > Par likhta to hai. [bolta not bohta :) ]
>
> See, I told you.
malle jongen ...
kind regards,
Jos ;-)
JosAHa at 2007-7-20 21:14:05 >

> > > Mujhe maloom hai.
> >
> > Mai Hindi nahi bohta
>
> Par likhta to hai. [bolta not bohta :) ]
Let me join in, as proxy for me m8, da ScarletPimp.
ere wtf r u duin talkin' posh just cuz u went to secondry skool.
cheers.
> > It all depends on what you think is fun :)> > I can think of a lot of things, but none being> related to programming.O_o The world would be so boring without programming ;)
kajbja at 2007-7-20 21:14:05 >

> > > > Mujhe maloom hai.
> > >
> > > Mai Hindi nahi bohta
> >
> > Par likhta to hai. [bolta not bohta :) ]
>
> Let me join in, as proxy for me m8, da ScarletPimp.
> ere wtf r u duin talkin' posh just cuz u went to secondry skool.
Check your ground wire; it seems a bit wobbly; the baud rate, parity
and start/stop bits settings look kind of ok.
kind regards,
Jos (^M)
JosAHa at 2007-7-20 21:14:05 >

Hmm.. I don't think you want me to post in German. I only studied German for 3 years, and that was almost 20 years ago. Hmm. I find it rather strange that I understood most of the German that was posted in the thread.
kajbja at 2007-7-20 21:14:05 >

> O_o The world would be so boring without programming ;)And that's exactly how I like it.
> > O_o The world would be so boring without> programming ;)> > And that's exactly how I like it.With or without whiskey growing in the trees?
kajbja at 2007-7-20 21:14:05 >

> Let me join in, as proxy for me m8, da ScarletPimp.> > ere wtf r u duin talkin' posh just cuz u went to> secondry skool.> I'll have you know that the school I attended was approved by the Queen> cheers.
> I'll have you know that the school I attended was> approved by the QueenBy Annie?
kajbja at 2007-7-20 21:14:10 >

> With or without whiskey growing in the trees?With, of course.
> > I'll have you know that the school I attended was> > approved by the Queen> > By Annie?Is there any other?
> > > I'll have you know that the school I attended
> was
> > > approved by the Queen
> >
> > By Annie?
>
> Is there any other?
I don't think so. That's why I'm so surprised. I didn't know that he approved schools :)
kajbja at 2007-7-20 21:14:10 >

> > With or without whiskey growing in the trees?> > With, of course.Dear Sir,I have this doubt concerning this quote from a french author:Le whisky est le cognac du con.Kindly explain to me what it means.
> > > > I'll have you know that the school I attended
> > was
> > > > approved by the Queen
> > >
> > > By Annie?
> >
> > Is there any other?
>
> I don't think so. That's why I'm so surprised. I
> didn't know that he approved schools :)
"He"? Annie is most definitely a very admirable "she", no doubt about it.
> I have this doubt concerning this quote from a french> author:> Le whisky est le cognac du con.> Kindly explain to me what it means.It means that Desproges doesn't seem to approve the fine taste of a Tullamore Dew.
> > I don't think so. That's why I'm so surprised. I
> > didn't know that he approved schools :)
>
> "He"? Annie is most definitely a very admirable
> "she", no doubt about it.
I'm either dyslectic, or to weak to push the keys. I've seen that I quite often miss some characters.
kajbja at 2007-7-20 21:14:10 >

> I'm either dyslectic, "dyslexic". The irony...> or to weak to push the keys.Hint: go shopping. :)
> It means that Desproges doesn't seem to approve the> fine taste of a Tullamore Dew.Ah. Off Kursk. Noah it whole mecque sins. The dew groaning on the tupperware tries. Tank u wary blutch.
> > It means that Desproges doesn't seem to approve
> the
> > fine taste of a Tullamore Dew.
>
> Ah. Off Kursk. Noah it whole mecque sins. The dew
> groaning on the tupperware tries. Tank u wary blutch.
Ach. I'm dispeptic. I'm soz.
> > I have this doubt concerning this quote from a french author:
> > Le whisky est le cognac du con.
> > Kindly explain to me what it means.
>
> It means that Desproges doesn't seem to approve the
> fine taste of a Tullamore Dew.
From what I remember from an old French girlfriend I met during the
holidays once and my French lessons at highschool, this means quite
something else ...
kind regards,
Jos ( < doesn't abuse the holy filters ;-)
JosAHa at 2007-7-20 21:14:10 >

> > I'm either dyslectic, > > "dyslexic". The irony...Strange, because I checked the word in www.websters-online-dictionary.org, and they had dyslectic (and dyslexic as synonym)Kaj
kajbja at 2007-7-20 21:14:10 >

> Hint: go shopping. :)I will bring a shopping cart when I go to the gym next time :)
kajbja at 2007-7-20 21:14:10 >

> Ach. I'm dispeptic. I'm soz.The real problem here is the OP's are so bloody lethargic! I seem to be unable to get any kind of response just by answering a question. You reply - silence.
kajbja at 2007-7-20 21:14:10 >

> I seem to be unable to get any kind of response just
> by answering a question. You reply - silence.
It's a stack problem. OP stacks have but three slots:
Phase 1: start
[slot 0] Matter
[slot 1] empty
[slot 2] empty
Phase 2: trouble
[slot 0] Trouble
[slot 1] Matter
[slot 2] empty
Phase 3: phrase trouble & post
[slot 0] Phrased question
[slot 1] Trouble
[slot 2] Matter
Phase 4: acknowledge answer
[slot 0] Answer
[slot 1] Phrased question
[slot 2] Trouble
*plop*
Phase 5: what was this all about again ?
[slot 0] Matter
[slot 1] Answer
[slot 2] Phrased question
*plop*
Phase 6: what was the trouble again ?
[slot 0] Trouble
[slot 1] Matter
[slot 2] Answer
*plop*
Phase 7: What does this answer mean ? What did I ask again ?
[slot 0] Phrased question
[slot 1] Trouble
[slot 2] Matter
*plop*
Phase 8: Ah, yes, so, now, what did he say ?
[slot 0] Answer
[slot 1] Phrased question
[slot 2] Trouble
*plop*
Et caetera. It's cyclic. The body reacts with fear, and runs off yelping.
> The body reacts with fear,> and runs off yelping.Other options:- restart at phase 3, i.e. ask the question again- restart at phase 2, i.e. start another thread- i did all that, but it still isn't woking- goldie, i.e. yell around
> It's a stack problem. OP stacks have but three slots:
>
> Phase 1: start
> [slot 0] Matter
> [slot 1] empty
> [slot 2] empty
>
> Phase 2: trouble
> [slot 0] Trouble
> [slot 1] Matter
> [slot 2] empty
That Sir, is one funny stack you've got there.
kind regards,
Jos (not even a few SWAPs and ROTs could do that job ;-)
JosAHa at 2007-7-20 21:14:19 >

> Jos (not even a few SWAPs and ROTs could do that jobI'll have you know that [url= http://www.mycraftshowroom.com/Mona%20Transfers/TR-Mona-Rottweiler-new.jpg]this ROT[/url] is very nice.
> > Jos (not even a few SWAPs and ROTs could do that job)> > I'll have you know that [this Rot] is very nice.You bad racist man.kind regards,Jos (her kitty kitty, go get the kidd^H^Htty ;-)
JosAHa at 2007-7-20 21:14:19 >

> That Sir, is one funny stack you've got there.> > kind regards,> > Jos (not even a few SWAPs and ROTs could do that job> ;-)Aye mate. It's made of the finest manucfatured funny slots you'll find on this side of the
> Aye mate. It's made of the finest manucfatured funny> slots you'll find on this side of the hemisphere.Plus it reminded me of [url http://bofh.ntk.net/StackMode.html]...[/url]
> > That Sir, is one funny stack you've got there.
> >
> > kind regards,
> >
> > Jos (not even a few SWAPs and ROTs could do that job ;-)
>
> Aye mate. It's made of the finest manucfatured funny
> slots you'll find on this side of the hemisphere.
Just two questions Sir:
1) Is your Stack class inflatable?
2) If not, can your funny slots contain any ScantilyCladWoman?
3) where's the javadocs of your class?
kind regards,
Jos
JosAHa at 2007-7-20 21:14:19 >

> Just two questions Sir:
>
> 1) Is your Stack class inflatable?
I just checked with our technicians, they say no, 'cause it's made of thin air and would thus explode. We have a pink version, though. Strawberry flavoured. The one I posted was our brand new flavour: we call it "dung". Lick your screen and you'll see. Well, taste, that is.
> 2) If not, can your funny slots contain any
> ScantilyCladWoman?
Certainly, sir. But only on mondays, when their spouses are at the bingo club. And you don't fit as a ScantilyCladWoman. Don't even dare think of trying.
> 3) where's the javadocs of your class?
You said two questions, sir.
Hi
I am working on a web page devlopment
i dont want to use any datatable.i am using panelgrid.
i want to add some componenets dynamically to a page. here is my code i am not able to undestand how to do.
jsp
<h:panelGrid columns="4" border="0" cellpadding="1" cellspacing="2" >
<h:outputText value="#{msgs.nameAddress}" styleClass="text"/>
<h:inputText id="name1" value="#{employeeInfo.name}"/>
<h:panelGrid columns="2">
<h:panelGroup>
<h:outputText value="#{msgs.street}" styleClass="text" />
<h:inputText id="street1" value="#{employeeInfo.street}" />
</h:panelGroup>
<h:panelGroup>
<h:outputText value="#{msgs.city}" styleClass="text" />
<h:inputText id="city1" value="#{employeeInfo.city}"/>
</h:panelGroup>
<h:panelGroup>
<h:outputText value="#{msgs.state}" styleClass="text" />
<h:inputText id="state1" value="#{employeeInfo.state}"/>
</h:panelGroup>
<h:panelGroup>
<h:outputText value="#{msgs.zip}" styleClass="text" />
<h:inputText id="zip1" value="#{employeeInfo.zip}"/>
</h:panelGroup>
</h:panelGrid>
<h:panelGrid columns="2">
<h:panelGroup>
<h:selectBooleanCheckbox id="selfemployed1" value="#{employeeInfo.selfEmp}"/>
<h:outputText value="#{msgs.selfEmp}" styleClass="text"/>
</h:panelGroup>
<h:panelGrid columns="2" border="1">
<h:outputText value="#{msgs.datefrom}" styleClass="text"/>
<h:inputText id="datefrom" value="#{employeeInfo.fromDate}"/>
<h:outputText value="#{msgs.dateto}" styleClass="text"/>
<h:inputText id="dateto" value="#{employeeInfo.toDate}"/>
<h:outputText value="#{msgs.monthInc}" styleClass="text"/>
<h:inputText id="monthinc" value="#{employeeInfo.montInc}"/>
</h:panelGrid>
</h:panelGrid>
<h:outputText value="#{msgs.postitbuss}" styleClass="text" />
<h:inputText id="position1" value="#{employeeInfo.position}" />
<h:outputText value="#{msgs.bussPhone}" styleClass="text" />
<h:inputText id="bussPh1" value="#{employeeInfo.bussPh}"/>
</h:panelGrid>
bean method:
ublic class employeeinfoBean implements Serializable {
private String name;
private String street;
private String city;
private String state;
private String zip;
private String fromDate;
private String toDate;
private String montInc;
private String selfEmp;
private String position;
private String bussPh;
/*private List criteria = new ArrayList();
public employeeinfoBean() {
employeeinfoBean criterion = new employeeinfoBean();
criteria.add(criterion);
}
/**
* Getter for property criteria.
* @return Value of property criteria.
*/
/* public List getCriteria() {
return criteria;
}
/**
* Setter for property criteria.
* @param criteria New value of property criteria.
*/
/*public void setCriteria(List criteria) {
this.criteria = criteria;
}
*/
public String getBussPh() {
return bussPh;
}
public void setBussPh(String bussPh) {
this.bussPh = bussPh;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getFromDate() {
return fromDate;
}
public void setFromDate(String fromDate) {
this.fromDate = fromDate;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPosition() {
return position;
}
public void setPosition(String position) {
this.position = position;
}
public String getSelfEmp() {
return selfEmp;
}
public void setSelfEmp(String selfEmp) {
this.selfEmp = selfEmp;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getStreet() {
return street;
}
public void setStreet(String street) {
this.street = street;
}
public String getToDate() {
return toDate;
}
public void setToDate(String toDate) {
this.toDate = toDate;
}
public String getZip() {
return zip;
}
public void setZip(String zip) {
this.zip = zip;
}
public String getMontInc() {
return montInc;
}
public void setMontInc(String montInc) {
this.montInc = montInc;
}
> Hi
>
> I am working on a web page devlopment
> i dont want to use any datatable.i am using
> panelgrid.
> i want to add some componenets dynamically to a page.
> here is my code i am not able to undestand how to
> do.
Then foer Heaven's sake create your own thread.
> > 3) where's the javadocs of your class?
>
>You said two questions, sir.
I apologise for that; I wanted to write 'five', sorry for the inconvenience
I might have caused.
> > 2) If not, can your funny slots contain any ScantilyCladWoman?
>
> Certainly, sir. But only on mondays, when their spouses are at the
> bingo club. And you don't fit as a ScantilyCladWoman. Don't even
> dare think of trying.
Discrimination! You bad racist man. What am I supposed to do with my
newly bought suspendies then?
kind regards,
Sir Loretta
JosAHa at 2007-7-20 21:14:19 >

> Nope, it's correct. It has both meanings.You can easily tell them!The plural in the meaning mother is "Mtter" whereas the plural in the other meaning is "Muttern". :-)