i feel like a retard! Java noob
I´ve been learning java for a week, yesterday while on bed, couldnt sleep i tought to myself, it would be a good excercise if i made a program where i would input the side of a square, then make the square representation.
Anyway i tought i would do this like in 10m, i spent 3hours till i got it right, feel a complete retard and my motivation is damm low right now.
Code :
import java.util.Scanner;
public class quadrado {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int quadrado;
System.out.println("Insert Square Size");
quadrado = input.nextInt();
int counter = 1;
int total=1;
while(counter<quadrado){
counter++;
total++;
System.out.print("O ");
if(counter==quadrado){
System.out.println("O ");
if((total)==(Math.pow(quadrado, 2))){break;}
counter=1;
total++;
}
}
}
}
Re: i feel like a retard! Java noob
As a specific question, get a specific answer. Ask no question, get no answer.
This thread has been cross posted here:
http://www.java-forums.org/new-java/64840-i-feel-like-retard-java-noob.html
Although cross posting is allowed,
for everyone's benefit, please read:
Java Programming Forums Cross Posting Rules
The Problems With Cross Posting
Re: i feel like a retard! Java noob
Learning for only a week?
Thinking about programming in your spare time?
Curious enough to write a program just because you think you can?
So you actually do it...and in only 3 hours...
Does it work?
..If every beginner had your problems, schools would not exist..
I entered 0, and nothing was printed as I expect.
I was not happy with entering 1, I expected to see a single zero printed instead of nothing
Other + integers worked as expected.
Pat yourself on the back for a job well done.
Perhaps troubleshoot and fix the code so that entering 1 will cause it to print a square of size 1 (a single zero).
Try to write the program a different way but make it do the same thing.
Modify the code so you can enter any letter of choice to build the square from instead of always 0.
Re: i feel like a retard! Java noob
Re: i feel like a retard! Java noob
thanks for the reply´s guys , so far i had learned seeing youtube bucky java tutorial´s which i thought were great, now ive picked java how to program book from deitel, it was a eye opener!! Everything explained in detail how it should really be.