-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChangeMaker.java
More file actions
36 lines (35 loc) · 990 Bytes
/
ChangeMaker.java
File metadata and controls
36 lines (35 loc) · 990 Bytes
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
public class ChangeMaker {
public static void main(String[] args) {
try {
int numArgs = Integer.parseInt(args[0]);
if (numArgs < 0) {
System.out.println("Cannot make change for negative amount.");
}
} catch (ArrayIndexOutOfBoundsException e) {
System.out.println("Given value is not an integer.");
}
}
public static int getQuarters(int cents) {
int quarters = (cents/25);
return(quarters);
}
public static int getDimes(int cents) {
//this is a stub
return 0;
}
public static int getNickels(int cents) {
//this is a stub
return 0;
}
public static int getPennies(int cents) {
//this is a stub
return 0;
}
public static int[] getChange(int cents) {
//this is a stub
return null;
}
}
//understanding exceptions (null) (IOException)
//how to command it to ignore an arg
//how to use each separate commit as a working team