Page 7 of 9 FirstFirst ... 456789 LastLast
Results 61 to 70 of 90
  1. #61

    6 more to go..... up! up! up! up!

    20 is solve.. tnx javaP

    update 1.2

    11-14-17-22-23-24

  2. #62
    Quote Originally Posted by FrozenBoi View Post

    11-14-17-22-23-24
    OT:
    Mura man sad ni numero sa LOTTO hehehe

    e pusta nalang ni, hahaha


  3. #63
    Quote Originally Posted by javapenguin View Post
    Problem #18

    Code:
    /*
     * 18. Write a Java class called Reverse, which defines a main() method that asks the user to enter a String s, 
     * and displays a new String consisting of the characters in s in the reverse order. 
     * You MUST NOT use any methods defined in the String class other than charAt() and length()
     */
    
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    
    /**
     *
     * @author javapenguin
     */
    
    public class Reverse {
    
        public static void main(String[] args) {
            BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
            
            String s = new String();
            
            System.out.println("Please enter a string: ");
            
            try {
                s = input.readLine();
            } catch (IOException ex) {
                System.err.println(ex);
            }
    
            char [] chr_array = new char[s.length()];
            
            int j = 0;
            
            for (int i = s.length()-1; i >= 0;i--) {
                chr_array[j] = s.charAt(i);
                j++;
            }
            
            //new string in reverse order
            String rs = new String(chr_array);
            
            System.out.println("The reverse is > "+rs);
        }
    
    }
    master nakoi pangutana dba sa instruction kai
    You MUST NOT use any methods defined in the String class other than charAt() and length()
    dyn sa code kai
    char [] chr_array = new char[s.length()];
    lahi ra na sila?

  4. #64
    String.length() raman ang function diha.

    Kalimot nako sa java pero i think sa kani na line:

    Code:
    char [] chr_array = new char[s.length()];
    kay ga declare na siya ug char type array named chr_array with size s.length()

  5. #65
    Quote Originally Posted by manick View Post
    master nakoi pangutana dba sa instruction kai
    You MUST NOT use any methods defined in the String class other than charAt() and length()
    dyn sa code kai
    char [] chr_array = new char[s.length()];
    lahi ra na sila?
    ok ra na bro kay array man na siya. Wala man gibutang nga do not use array. Ang method diha kay length()

  6. #66
    Quote Originally Posted by javapenguin View Post
    ok ra na bro kay array man na siya. Wala man gibutang nga do not use array. Ang method diha kay length()
    ah ok pwede ra diay. nag ka anam na man ko ka kalimot ug java oi haha

  7. #67
    Code:
    /*
     * 22. Write a Java class called DestroyAllOccurrences, which defines a main() method that asks the user to enter
     * two Strings superString and subString, and displays a new String consisting of all characters in superString
     * with all occurrences of subString deleted. You MUST NOT use any of the methods defined in the String class
     * other than charAt() and length().
     */
    
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    
    /**
     *
     * @author javapenguin
     */
    public class DestroyAllOccurrences {
    
        public static void main(String[] args) {
            BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
    
            String superString = new String();
            String subString = new String();
    
            System.out.println("Please enter a super string: ");
    
            try {
                superString = input.readLine();
            } catch (IOException ex) {
                System.err.println(ex);
            }
    
            System.out.println("Please enter a sub string: ");
    
            try {
                subString = input.readLine();
            } catch (IOException ex) {
                System.err.println(ex);
            }
    
            String newString = "";
    
            boolean found = true;
    
            for (int i = 0; i < superString.length(); i++) {
                found = false;
                for (int j = 0; j < subString.length(); j++) {
                    if (superString.charAt(i) == subString.charAt(j)) found = true;
                }
    
                if (!found) {
                    newString = newString+superString.charAt(i);
                }
            }
    
            System.out.println("New String > "+newString);
        }
    
    }

  8. #68
    unsay kuwang ani?

    up ^

  9. #69
    Quote Originally Posted by dwardwarbinx View Post
    unsay kuwang ani?

    up ^
    update 1.3

    11-14-17-23-24 nlng.....

  10. #70
    up..up..up..... gmay nlng..

  11.    Advertisement

Page 7 of 9 FirstFirst ... 456789 LastLast

Similar Threads

 
  1. Need Help in java. AGAIN! =)
    By jairoh_ in forum Programming
    Replies: 11
    Last Post: 02-29-2012, 08:13 AM
  2. Help in java. Arrays
    By jairoh_ in forum Programming
    Replies: 25
    Last Post: 02-03-2012, 07:48 PM
  3. Help in java
    By jairoh_ in forum Programming
    Replies: 12
    Last Post: 01-11-2012, 10:22 AM
  4. NEED HELP in JAVA EXCELAPI
    By rastaman81 in forum Programming
    Replies: 1
    Last Post: 05-11-2009, 09:17 PM
  5. need help in java programming: creating a folder
    By rastaman81 in forum Programming
    Replies: 4
    Last Post: 03-11-2009, 08:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top