Professional Documents
Culture Documents
}
}
1
j. System.out.print(s1.indexOf(s2) );
k. System.out.print(s1.regionMatches(7,s2,1,2 );
l. System.out.printf("%5d",s1.indexOf(s2.substring(1,3)) );
m. System.out.print(s1.indexOf(s2.substring(1,3) , 8) );
n. System.out.printf("%.2f",(double)s1.length() – s2.length());
o. System.out.printf("%15s",s1.substring( 6 , 12) . toLowerCase());
price = Double.parseDouble(
JOptionPane.showInputDialog("Please enter the sales "
+ "price of the home."));
outputStr1 =
String.format("The %s's home sold for $%.2f", owner, price);
outputStr2 =
String.format("%nThe cost to sell the home was $%.2f", cost);
outputStr3 =
String.format("%nThe selling or listing agent earned $%.2f",
commission);
System.exit(0);
}
2
}