-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLoops.java
52 lines (41 loc) · 1.12 KB
/
Loops.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
name: Jamie Johnson
Assignment:
Problem:
*/
import java.util.Scanner;
public class Loops
{
public static void main(String args[])
{
// for ( int n = 4; n <= 14; n += 2)
// System.out.println("n is: " + n);
// for ( int n = 100; n <= 350; n += 50)
// System.out.println("n is: " + n);
// int x;
// int count = 0;
//
// Scanner keyboard = new Scanner(System.in);
//
// System.out.println("Please enter a number");
// x = keyboard.nextInt();
//
// while( x != -1 )
// {
// if ( x % 2 != 0 )
// {
// count ++;
// }
// System.out.println("Please enter another number ");
// x = keyboard.nextInt();
// }
// System.out.println("There were " + count + " odd numbers");
int q;
final int quarter = 4;
Scanner keyboard = new Scanner(System.in);
System.out.println("Please enter the number of quarters you have... ");
q = keyboard.nextInt();
q %= quarter;
System.out.println("You have " + q + " quarters.");
}
}