Vendrick-Xander

HW #10

Dec 16th, 2018
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. 12. Char
  2.  
  3. 33. Scanner scan = new Scanner(System.in);
  4.  
  5. System.out.print( "Enter a character: ");
  6. String input = scan.next();
  7. char c = input.charAt(0);(why need this?)
  8. boolean digit = Chracter.isLetter(c);
  9. if digit == 1{
  10. System.out.println("true");
  11. else{
  12. System.out.println("false");
  13.  
  14. 35. missing the java. before the text.NumberFormat
  15.  
  16. 44. the 'n' needs to be lowercased for the program to recognize the class(?)
  17.  
  18. 71. You might want to use parse int to compare what the user input, because if you prompt the user to input a number that you know is an integer because that is what you told them, then having that valued be stored as int would be helpful so that it could be compared more easily
  19. 72. the Math, DecimalFormat, and NumberFormat classes are extrememly helpful each in different ways. Math, for instance, is often used in programs that uses trig, or just to return the absolute value of a number. NumberFormat and Decimalformat seem helpful for changing the way that something is printed to the user, such as with the NumberFormat changing values to currency, if that is what the programmer want to display to the user
Add Comment
Please, Sign In to add comment