Suppose you are implementing the following class representing 7-digit phone numbers in the form "XXX-XXXX" for a phone in the immediate OSU area. That is, you may assume the length of the PhoneNumber value is 8 and that each "X" is a digit '0'-'9'.
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
/**
 * Simple class representing a 7-digit phone number in the form "XXX-XXXX"
 * for a phone in the immediate OSU area.
 */
public class PhoneNumber {
 
    /**
     * The phone number representation.
     */
    private String rep;
 
    /**
     * Constructor. {@code pNum} must be in the form "XXX-XXXX" where each
     * "X" is a digit '0'-'9'.
     */
    public PhoneNumber(String pNum) {
        this.rep = pNum;
    }
 
    ...
 
    @Override
    public int hashCode() {
 
        // TODO - fill in body
 
    }
 
    ...
}
Write the code to implement the hashCode instance method. You can use the Character.digit(char ch, int radix) method to convert a "digit" character ch into the corresponding numeric value in the specified radix.