public class Wa {
//
// isLike
// Returns true if all chars in source are found in target.
//
public static boolean isLike(String source, String target) {
for (int x = 0; x < source.length(); x++) {
}
}
//
// isInteger
// Returns true if string represents an integer
// (integer variable max and min values do not need to be considered)
//
// Examples of "good" integer strings:
// "123456789"
// "00023" allow leading zeros
// " 87 " allow leading and trailing spaces
//
// Examples of "bad" integer strings:
// "34*$D3456(9" bad symbols
// "23.6" bad symbols
// "45 454" string should be one integer
//
public static boolean isInteger(String source) {
}
//
// toInteger
// Converts a string to an integer value.
// If string is an invalid integer, return 0.
// (integer variable max and min values do not need to be considered)
//
public static int toInteger(String source) {
}
//
// isDouble
// Returns true if string represents a double
//
// Examples of "good" integer strings:
// "12.7"
// "98."
// "00023.00" allow leading zeros
// " 87.7 " allow leading and trailing spaces
//
// Examples of "bad" integer strings:
// "34*8D3.456$(9" bad symbols
// "2.3.6" too many decimals
// "45 4.54" string should be one double
//
public static boolean isDouble(String source) {
}
// main
public static void main(String args[]) {
// test your methods
}
}
how do i tackle this? Do i have to loop the two strings twice then store each letter as a variable and see if the two variables are equal?
any help would be greatly appreciated
bkim33 is online now Edit/Delete Message


Sign In
Create Account

Back to top









