hahaha, ahaka javapenquin oi, hehehe. dili pa kuno pakyawon. Humana jud na 25 programs bah!
FrozenBoi: kinsa inyong teacher sa JAVA?
**Update sad ninyo kung pila na kabook ang na.solve para dili mag.duplicate ug buhat!
@istoryans tagae lng sila program flow or logic or flowchart sa mga problem kaysa tagaan sila ready made na code... para ma challenge sd sila nd makat.on pa jud... luoy ayo ni sila if dle mgkat.on patay ni sa real world of IT or Software2 thing if kana dle mo mg.call center heheh suggestion lng ni ha....
Ahw hehe pero applicable mn japon na nila COMP.E mn sd gud ko nd sa software mn ko na butang heheh dle sa Hardware if sa hardware sd sila ma position possible sd nila magamit if ma FIRMWARE developer sila, atleast lng mdyo familiar na sila ug code2 hehehe ako ra sd ni opinion.....
yup pseudo code na lang..
ka-remember ko sauna, ang reason nagpa-register ko sa iSTORYA.NET kay nangayo answer sa ako C programming na homework..
example lang ni:
Code:/** * 25.Write a Java class called CountWords, which defines a main() method that asks the user to * enter a String s, and displays the number of words in s. A word is delimited by one or many space * characters. You MUST NOT not use any of the methods defined in the String class other than * charAt() and length(). In addition, you MUST NOT use the StringTokenizer class. * * @author bishop__ */ import javax.swing.*; import java.text.*; class CountWords { public static void main( String[] args ) { String s; int words = 0, index, len, notspace = 0; s = JOptionPane.showInputDialog(null, "Enter string:"); s += " "; len = s.length(); for (index = 0; index < len; index++) { if (s.charAt(index) != ' ') { notspace = 1; } else { if (notspace == 1) words++; notspace = 0; } } JOptionPane.showMessageDialog(null, "Word Count: " + words); } }
cguro enough na ni bro para naa moy mabasihan pag convert sa inyong c++ code to java.
example lang man ning ako-a para naa na mo idea
Code:/* * 21. Write a Java class called Equals, which defines a main() method that * asks the user to enter two Strings s1 and s2, and displays whether or not * s1 and s2 are equal. Two Strings are equal if they are of the same length * and the same characters appear in the same positions. You MUST NOT use any * of the methods defined in the String class other than charAt() and length(). * * @author bishop__ */ import javax.swing.*; import java.text.*; class Equals { public static void main( String[] args ) { String s1, s2; int result = 0, len, index; s1 = JOptionPane.showInputDialog(null, "Enter first string:"); s2 = JOptionPane.showInputDialog(null, "Enter second string:"); len = s1.length(); if (len != s2.length()) { result = -1; } else { for (index = 0; index < len; index++) { if (s1.charAt(index) != s2.charAt(index)) { result = -1; } } } if (result == 0) { JOptionPane.showMessageDialog(null, "Equal !\n" + s1 + " == " + s2); } else { JOptionPane.showMessageDialog(null, "Not Equal !\n" + s1 + " != " + s2); } } }
Similar Threads |
|