Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2. do/while
- 4. true
- 6. Hello
- Enter an int >
- Hello
- Enter an int >
- 8. sum is 54
- i is 19
- 10. product is 6
- i is 7
- 12. Hello
- Hello
- Hello
- Done
- 14. 2033
- 16. i is 39 and sum is 60
- 18. sum is 40
- 20. sum is 21
- i is 7
- 22. do {
- System.out.println("Type another integer >");
- int newNum = scan.nextInt();
- }
- while ( newNum > start );
- 24. for(countMultiplesOf7; countMultiplesOf7 < 4; countMultiplesOf7 ++){
- sum + = countMultiplesOf7 * 7;
- }
- 26. Scanner scan = new Scanner( new File ("Example.file"));
- int sum = 0;
- while( scan.hasDigit()){
- sum + = scan.nextDigit();
- }
- 28. Scanner scan = new Scanner(System.in);
- do{
- System.out.println("Type another integer >");
- int newNum = scan.nextInt();
- }while( newNum != 0 && newNum != 100 );
- 30. i never iterates so the while loop only executes once.
- 32. There is a semi colon after the parentheses of the for loop.
- 34. The while loop should have and not or.
- 36. There should be a semicolon in front of the while condition.
- 38. the program is reading the incrementor and the limit in the wrong order and place. place the i++ after the i < 3.
- 40. you place commas instead of semi colons so it doesn't know where the statements end. replace the commas in the for loop with semi colons.
- 42. You already declared a variable name i above, and you can't name two variable with the same name in one class. Remove the int in front of the i when initiating the i in the for loop.
Add Comment
Please, Sign In to add comment