Author Topic: Mga guru pa help po sa java....  (Read 37 times)

0 Members and 1 Guest are viewing this topic.

Offline arpee

  • EquiBerks
  • Jr. Member
  • *
  • Posts: 81
  • Karma: +1/-0
    • View Profile
Mga guru pa help po sa java....
« on: March 29, 2010, 01:28:56 PM »
Mga guru  help naman po sa java....

Eto po ung code ko...
Ang gusto ko po sana malagay ko sa array ung number na ininput ng user..kaso may mali po.. pa help mga guru....

Quote
public static void main(String[] args){

BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter a number: ");
String inputx = input.readline();
char[] inputy = new char[4];

for(int i=0; i<=3; i++){
for(int j=0; j<=3; j++){
inputy = inputx.charAt(j);
}
}

//kaso po pag hinanap ko na laman ng array ang nalabas ung huling number na ininput ko...
System.out.println(inputy[2]);

}
}
« Last Edit: July 24, 2014, 09:38:02 AM by arpee »

Techronnati | where technology never sleeps

Mga guru pa help po sa java....
« on: March 29, 2010, 01:28:56 PM »

Mountain View

Offline Transformer10

  • Full Member
  • *
  • Posts: 104
  • Karma: +0/-0
    • View Profile
Re: Mga guru pa help po sa java....
« Reply #1 on: March 29, 2010, 01:29:15 PM »
Lagay mo sa do while yung pag kuha ng input ang pag enter ng value.
para mapuno mo yung laman ng array.

pwede rin isang for loop lang. kada ikot meron kang input.readline.
kada kuha mo ng value lagay mo sa corresponding array.

kung ano mapili mo ngayon sa dalawang approach na to.
gawa ka ng unlimited do while loop na humihingi kung ano gusto mo i output from the 4 choices.

 

Related Topics


Posting Disclaimer: Any individual may post a message in this forum and may do so anonymously. Therefore, the sole author is exclusively and entirely responsible for all opinions in that message. They do not represent the official opinions of Techronnati, its administrators or moderators or the Techronnati Management. Techronnati is merely acting as an impartial conduit for constitutionally protected free speech and is not responsible and will not be held liable for the content of such messages. All images and service logos are trademarks of their respective owners.