Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created by Daniel on 4/1/2016.
- */
- public class selfcheck1925 {
- }
- /*
- 19.
- a.13
- b.7
- c. G
- d. 2
- e.GANDALF THE GRAY
- f.-1
- g. Frodo
- h.dalf the GRA
- i.Goondoolf the GRAY
- j. Gandalf the GRAY
- k. strange1
- 21.
- String quote = "Four score and seven years ago";
- //to produce SCORE :
- String score = quote.substring(5,10);
- String SCORE = score.toUpperCase();
- System.out.println(SCORE);//test
- //to produce four years
- String years = quote.substring(21,26);
- String Four = quote.substring(0,4);
- String four = Four.toLowerCase();
- String fourYears = four + " " + years;
- System.out.println(fourYears); //test
- 23.
- a. 34.50 will be stored
- b. the program will return the int 6 as a double 6.0
- c. the program will fail because the $ sign character can not be stored in a int/double
- d. the program will fail million is not an int/double
- e. the program will again fail because the * character is not an int/double
- f. the program will fail because of the x symbol
- g. it will again fail because of the none, because it is not a int/double
- h. 645 will be converted it to the double 645.0
- 25.
- public class sumNumbers {
- public static void main(String[] args){
- Scanner console = new Scanner(System.in);
- System.out.print("low?");
- int low = console.nextInt();
- System.out.print("high?");
- int high = console.nextInt();
- int sum = 0;
- for (int i =low; i<= high; i++) {
- sum+= i;
- }
- System.out.println("sum = " + sum);
- }
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment