Guest User

Untitled

a guest
Sep 29th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1.  
  2. import java.util.Scanner;
  3.  
  4. /*
  5. * HW4 CountBy
  6. * Kenny Lo 12
  7. * September 2018
  8. * Professor Stefan
  9. * CSE 1310-001 T-TH 9:30 AM to 10:50 AM
  10. */
  11. public class HW4_CountBy {
  12.  
  13. public static void main(String[] args) {
  14. Scanner kb = new Scanner(System.in);
  15.  
  16. // Define Variables
  17. int start, end, step;
  18. String output = "";
  19.  
  20. // Prompt
  21. System.out.println("This program will be counting by a certain step.");
  22. System.out.println("Enter what you want the start, end and stop values to be.");
  23. System.out.print("start is: ");
  24. start = kb.nextInt();
  25. System.out.print("end is: ");
  26. end = kb.nextInt();
  27. System.out.print("step is: ");
  28. step = kb.nextInt();
  29.  
  30.  
  31. for (int st = start; st <= end; st+=step){
  32. output = output.
  33. }
  34. System.out.print("The sequence is: ");
  35. System.out.print(st);
  36. }
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment